1# CodecBase 2 3<!--Kit: AVCodec Kit--> 4<!--Subsystem: Multimedia--> 5<!--Owner: @mr-chencxy--> 6<!--Designer: @dpy2650---> 7<!--Tester: @baotianhao--> 8<!--Adviser: @zengyawen--> 9 10## Overview 11 12The CodecBase module provides the variables, attributes, and functions for basic audio and video multiplexing, demultiplexing, encoding, and decoding. 13 14**System capability**: SystemCapability.Multimedia.Media.CodecBase 15 16**Since**: 9 17 18### Media Codec Formats 19 20The table below lists the media codec formats. The type is a constant string. 21 22| Name | Description | 23| ------------------------------------------------------------ | ------------------------------------------------------ | 24| [OH_AVCODEC_MIMETYPE_AUDIO_AAC](#oh_avcodec_mimetype_audio_aac) | MIME type of the AAC audio codec. | 25| [OH_AVCODEC_MIMETYPE_AUDIO_FLAC](#oh_avcodec_mimetype_audio_flac) | MIME type of the FLAC audio codec. | 26| [OH_AVCODEC_MIMETYPE_AUDIO_OPUS](#oh_avcodec_mimetype_audio_opus) | MIME type of the Opus audio codec. <!--Del-->(This specification is not available yet.)<!--DelEnd--> | 27| [OH_AVCODEC_MIMETYPE_AUDIO_G711MU](#oh_avcodec_mimetype_audio_g711mu) | MIME type of the G.711 mu-law audio codec. | 28| [OH_AVCODEC_MIMETYPE_AUDIO_G711A](#oh_avcodec_mimetype_audio_g711a) | MIME type of the G.711 a-law audio decoder. | 29| [OH_AVCODEC_MIMETYPE_AUDIO_RAW](#oh_avcodec_mimetype_audio_raw) | MIME type of raw audio streams. | 30| [OH_AVCODEC_MIMETYPE_AUDIO_VORBIS](#oh_avcodec_mimetype_audio_vorbis) | MIME type of the Vorbis audio decoder. | 31| [OH_AVCODEC_MIMETYPE_AUDIO_MPEG](#oh_avcodec_mimetype_audio_mpeg) | MIME type of the MP3 audio codec. | 32| [OH_AVCODEC_MIMETYPE_AUDIO_VIVID](#oh_avcodec_mimetype_audio_vivid) | MIME type of the Audio Vivid audio decoder. <!--Del-->(This specification is not available yet.)<!--DelEnd--> | 33| [OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB](#oh_avcodec_mimetype_audio_amr_nb) | MIME type of the AMR-NB audio<!--RP4--><!--RP4End--> decoder. | 34| [OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB](#oh_avcodec_mimetype_audio_amr_wb) | MIME type of the AMR-WB audio<!--RP4--><!--RP4End--> decoder. | 35| [OH_AVCODEC_MIMETYPE_AUDIO_APE](#oh_avcodec_mimetype_audio_ape) | MIME type of the APE audio decoder. | 36| [OH_AVCODEC_MIMETYPE_VIDEO_VVC](#oh_avcodec_mimetype_video_vvc) | MIME type of the VVC (H.266) video codec. | 37| [OH_AVCODEC_MIMETYPE_VIDEO_HEVC](#oh_avcodec_mimetype_video_hevc) | MIME type of the HEVC (H.265) video codec. | 38| [OH_AVCODEC_MIMETYPE_VIDEO_AVC](#oh_avcodec_mimetype_video_avc) | MIME type of the AVC (H.264) video codec. | 39| [OH_AVCODEC_MIMETYPE_VIDEO_H263](#oh_avcodec_mimetype_video_h263) | MIME type of the H.263 video codec. | 40| [OH_AVCODEC_MIMETYPE_VIDEO_MPEG4](#oh_avcodec_mimetype_video_mpeg4) | MIME type of the MPEG4 video encoder, which is used only for multiplexing MPEG4 video streams. (It is deprecated from API version 11.)| 41| [OH_AVCODEC_MIMETYPE_VIDEO_MPEG4_PART2](#oh_avcodec_mimetype_video_mpeg4_part2) | MIME type of the MPEG4 Part 2 video codec.| 42| [OH_AVCODEC_MIMETYPE_VIDEO_MPEG2](#oh_avcodec_mimetype_video_mpeg2) | MIME type of the MPEG2 video codec.| 43| [OH_AVCODEC_MIMETYPE_IMAGE_JPG](#oh_avcodec_mimetype_image_jpg) | MIME type of the JPG image encoder, which is used only for multiplexing JPG covers. | 44| [OH_AVCODEC_MIMETYPE_IMAGE_PNG](#oh_avcodec_mimetype_image_png) | MIME type of the PNG image encoder, which is used only for multiplexing PNG covers. | 45| [OH_AVCODEC_MIMETYPE_IMAGE_BMP](#oh_avcodec_mimetype_image_bmp) | MIME type of the BMP image encoder, which is used only for multiplexing BMP covers. | 46| [OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT](#oh_avcodec_mimetype_subtitle_webvtt) |MIME type of the WEBVTT subtitle demuxer. | 47| [OH_AVCODEC_MIMETYPE_SUBTITLE_SRT](#oh_avcodec_mimetype_subtitle_srt) |MIME type of the SRT subtitle demuxer. | 48 49 50### Media Data Key-Value Pairs 51 52The tables below list the key-value pairs used to describe media data. The key type is a constant string, and the value type can be int32_t, int64_t, float, double, char *, or uint8_t *. 53 54The [OH_AVFormat](_core.md#oh_avformat) API is used to configure or query parameters. 55 56Key-value pairs dedicated for capability query: 57 58| Name | Description | 59| ------------------------------------------------------------ | ------------------------------------------------------------ | 60| [OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT](#oh_feature_property_key_video_encoder_max_ltr_frame_count) | Maximum number of long-term reference (LTR) frames obtained during video encoding. The value type is int32_t.| 61 62Common key-value pairs of audio and video: 63 64| Name | Description | 65| ------------------------------------------------------------ | ------------------------------------------------------------ | 66| [OH_MD_KEY_CODEC_CONFIG](#oh_md_key_codec_config) | Codec-specific data. In the case of video, data carried in **SPS/PPS** is transferred. In the case of audio, data carried in **extraData** is transferred. The value type is uint8_t\*. This key is optional. <!--Del-->(This key is not supported yet for the video codec.)<!--DelEnd--> | 67| [OH_MD_MAX_INPUT_BUFFER_COUNT](#oh_md_max_input_buffer_count) | Maximum number of input buffers. The value type is int32_t. This key is optional. | 68| [OH_MD_MAX_OUTPUT_BUFFER_COUNT](#oh_md_max_output_buffer_count) | Maximum number of output buffers. The value type is int32_t. This key is optional. | 69| [OH_MD_KEY_BITRATE](#oh_md_key_bitrate) | Bit rate. The value type is int64_t. This key is used in audio and video encoding scenarios. It is optional in video encoding scenarios.| 70| [OH_MD_KEY_PROFILE](#oh_md_key_profile) | Encoding grading. The value type is int32_t. For details, see [OH_AVCProfile](#oh_avcprofile), [OH_HEVCProfile](#oh_hevcprofile), and [OH_AACProfile](#oh_aacprofile). This key is optional.| 71| [OH_MD_KEY_MAX_INPUT_SIZE](#oh_md_key_max_input_size) | Maximum size of an input stream to decode. The value type is int32_t. This key is optional. | 72| [OH_MD_KEY_ENABLE_SYNC_MODE](#oh_md_key_enable_sync_mode) | Enabled status of audio/video codec synchronization. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and used only in the configuration phase.| 73 74 75Key-value pairs dedicated for video: 76 77| Name | Description | 78| ------------------------------------------------------------ | ------------------------------------------------------------ | 79| [OH_ED_KEY_TIME_STAMP](#oh_ed_key_time_stamp) | Surface buffer timestamp. The value is of the int64_t type. This key is optional. (It is deprecated from API version 14.)| 80| [OH_ED_KEY_EOS](#oh_ed_key_eos) | End of stream for the surface buffer. The value type is int32_t. This key is optional. (It is deprecated from API version 14.)| 81| [OH_MD_KEY_WIDTH](#oh_md_key_width) | Video width. The value type is int32_t. | 82| [OH_MD_KEY_HEIGHT](#oh_md_key_height) | Video height. The value type is int32_t. | 83| [OH_MD_KEY_PIXEL_FORMAT](#oh_md_key_pixel_format) | Video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).| 84| [OH_MD_KEY_FRAME_RATE](#oh_md_key_frame_rate) | Video frame rate. The value type is double. This key is optional. | 85| [OH_MD_KEY_RANGE_FLAG](#oh_md_key_range_flag) | Video YUV value range flag. The value type is int32_t. The value **1** means a full range, and **0** means a limited range. This key is optional.| 86| [OH_MD_KEY_COLOR_PRIMARIES](#oh_md_key_color_primaries) | Video primary colors. The value type is int32_t. For details, see [OH_ColorPrimary](#oh_colorprimary). The value complies with Table 2 in H.273. This key is optional.| 87| [OH_MD_KEY_TRANSFER_CHARACTERISTICS](#oh_md_key_transfer_characteristics) | Video transfer characteristics. The value type is int32_t. For details, see [OH_TransferCharacteristic](#oh_transfercharacteristic). The value complies with Table 3 in H.273. This key is optional.| 88| [OH_MD_KEY_MATRIX_COEFFICIENTS](#oh_md_key_matrix_coefficients) | Video matrix coefficients. The value type is int32_t. For details, see [OH_MatrixCoefficient](#oh_matrixcoefficient). The value complies with Table 4 in H.273. This key is optional.| 89| [OH_MD_KEY_VIDEO_STRIDE](#oh_md_key_video_stride) | Stride of the video frame. The value type is int32_t. This key is optional. | 90| [OH_MD_KEY_VIDEO_SLICE_HEIGHT](#oh_md_key_video_slice_height) | Height of the video frame. The value type is int32_t. This key is optional. | 91| [OH_MD_KEY_VIDEO_PIC_WIDTH](#oh_md_key_video_pic_width) | Width of the video frame. The value type is int32_t. This key is optional. | 92| [OH_MD_KEY_VIDEO_PIC_HEIGHT](#oh_md_key_video_pic_height) | Height of the video frame. The value type is int32_t. This key is optional. | 93| [OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE](#oh_md_key_video_encode_bitrate_mode) | Video encoding bit rate mode. The value type is int32_t. For details, see [OH_BitrateMode](#oh_bitratemode-1). This key is optional.| 94| [OH_MD_KEY_QUALITY](#oh_md_key_quality) | Required encoding quality. The value type is int32_t. This key applies only to encoders configured in constant quality mode. This key is optional.| 95| [OH_MD_KEY_REQUEST_I_FRAME](#oh_md_key_request_i_frame) | Request for immediate encoding of I-frames. The value type is int32_t. This key is optional. | 96| [OH_MD_KEY_I_FRAME_INTERVAL](#oh_md_key_i_frame_interval) | Key frame interval, in milliseconds. The value type is int32_t. This key is optional and is used only for video encoding.| 97| [OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY](#oh_md_key_video_encoder_enable_temporal_scalability) | Enabled status of temporal scalability. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and used only in the configuration phase of video encoding.| 98| [OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE](#oh_md_key_video_encoder_temporal_gop_size) | Size of a temporal image group. The value type is int32_t. This key is valid only when temporal scalability is enabled. This key is optional and used only in the configuration phase of video encoding.| 99| [OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE](#oh_md_key_video_encoder_temporal_gop_reference_mode) | Reference mode in a temporal image group. The value type is int32_t. For details, see [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode-1). This key is valid only when temporal scalability is enabled. This key is optional and used only in the configuration phase of video encoding.| 100| [OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT](#oh_md_key_video_encoder_ltr_frame_count) | Number of LTR frames. The value type is int32_t. The value must be within the supported value range. This key is optional and is used only for video encoding.| 101| [OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR](#oh_md_key_video_encoder_per_frame_mark_ltr) | Whether the current frame is marked as an LTR frame. The value type is int32_t. **1** if marked, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and is used only for video encoding.| 102| [OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR](#oh_md_key_video_encoder_per_frame_use_ltr) | POC number of the LTR frame referenced by the current frame. The value type is int32_t. This key is optional and is used only for video encoding.| 103| [OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR](#oh_md_key_video_per_frame_is_ltr) | Whether the frame corresponding to the stream output from the current [OH_AVBuffer](_core.md#oh_avbuffer) is marked as an LTR frame. The value type is int32_t. **1** if marked, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and is used only for video encoding.| 104| [OH_MD_KEY_VIDEO_PER_FRAME_POC](#oh_md_key_video_per_frame_poc) | POC number of the frame. The value type is int32_t. This key is optional and is used only for video encoding.| 105| [OH_MD_KEY_VIDEO_ENCODER_QP_MAX](#oh_md_key_video_encoder_qp_max) | Maximum Quantization Parameter (QP) allowed by the video encoder. The value type is int32_t. This key is optional and is used only for video encoding.| 106| [OH_MD_KEY_VIDEO_ENCODER_QP_MIN](#oh_md_key_video_encoder_qp_min) | Minimum QP allowed by the video encoder. The value type is int32_t. This key is optional and is used only for video encoding.| 107| [OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE](#oh_md_key_video_encoder_qp_average) |Average QP of video frames. The value type is int32_t. This key is optional and is used only for video encoding. | 108| [OH_MD_KEY_VIDEO_ENCODER_MSE](#oh_md_key_video_encoder_mse) |Mean Squared Error (MSE) of video frames. The value type is double. This key is optional and is used only for video encoding. | 109| [OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER](#oh_md_key_video_encoder_repeat_previous_frame_after) | Duration (in milliseconds) for which the last frame will be resubmitted repeatedly, if no new frame is available after the previous frame is submitted to the encoder. The value type is int32_t. This key is used only in the configuration phase of video encoding in surface mode.| 110| [OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT](#oh_md_key_video_encoder_repeat_previous_max_count) | Maximum number of times the encoder can repeat encoding the previous frame when no new frame is available. The value type is int32_t. This key takes effect only when **OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER** is available and is used only in the configuration phase.| 111| [OH_MD_KEY_SQR_FACTOR](#oh_md_key_sqr_factor) | Quality parameter in SQR mode. The value range is [0, 51] (same as the QP value in encoding). A smaller value indicates a higher output bit rate and better quality. The value type is int32_t. This key is optional and is used only for video encoding.| 112| [OH_MD_KEY_MAX_BITRATE](#oh_md_key_max_bitrate) | Maximum bit rate in SQR mode. The value range can be obtained by calling [OH_AVCapability_GetEncoderBitrateRange](_a_v_capability.md#oh_avcapability_getencoderbitraterange) and is the same as that of [OH_MD_KEY_BITRATE](#oh_md_key_bitrate). The unit is bit/s. The value type is int64_t. This key is optional and is used only for video encoding.| 113| [OH_MD_KEY_VIDEO_ENCODER_ROI_PARAMS](#oh_md_key_video_encoder_roi_params) | ROI encoding parameters, including the ROI area and deltaQp. The value type is string. This key is optional and is used only for video encoding.| 114| [OH_MD_KEY_VIDEO_ENCODER_ENABLE_PTS_BASED_RATECONTROL](#oh_md_key_video_encoder_enable_pts_based_ratecontrol) | Enabled status of the PTS-based bit rate control mode. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and is used only for video encoding. If this feature is enabled, each video frame must contain PTS information and be sent to the encoder. It is used in the configuration phase.| 115| [OH_MD_KEY_VIDEO_ENCODER_ENABLE_B_FRAME](#oh_md_key_video_encoder_enable_b_frame) | Enabled status of B-frame encoding. The value type is int32_t. **1** if enabled, **0** otherwise. This key is optional and used only in the configuration phase of video encoding. The default value is **0**.| 116| [OH_MD_KEY_VIDEO_ENCODER_MAX_B_FRAMES](#oh_md_key_video_encoder_max_b_frames) | Maximum number of B-frames supported by B-frame encoding in video encoding. The value type is int32_t.| 117| [OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE](#oh_md_key_video_decoder_output_color_space) | Output color space of the video decoder. The value type is int32_t. The supported value is **OH_COLORSPACE_BT709_LIMIT**.| 118| [OH_MD_KEY_ROTATION](#oh_md_key_rotation) | Rotation angle of the surface. The value type is int32_t, and the value range is {0, 90, 180, 270}. The default value is 0. This key is optional and is used only for video decoding in surface mode | 119| [OH_MD_KEY_SCALING_MODE](#oh_md_key_scaling_mode) | Video scaling mode. The value type is int32_t. For details, see [OH_ScalingMode](#oh_scalingmode). This key is optional and is used only for video decoding in surface mode. You are advised to set the scaling mode by calling [OH_NativeWindow_NativeWindowSetScalingModeV2](../apis-arkgraphics2d/capi-external-window-h.md#oh_nativewindow_nativewindowsetscalingmodev2). (It is deprecated from API version 14.)| 120| [OH_MD_KEY_VIDEO_CROP_TOP](#oh_md_key_video_crop_top) | Top coordinate (y) of the cropped rectangle. The value type is int32_t. This key is optional and is used only for video decoding.| 121| [OH_MD_KEY_VIDEO_CROP_BOTTOM](#oh_md_key_video_crop_bottom) | Bottom coordinate (y) of the cropped rectangle. The value type is int32_t. This key is optional and is used only for video decoding.| 122| [OH_MD_KEY_VIDEO_CROP_LEFT](#oh_md_key_video_crop_left) | Left coordinate (x) of the cropped rectangle. The value type is int32_t. This key is optional and is used only for video decoding.| 123| [OH_MD_KEY_VIDEO_CROP_RIGHT](#oh_md_key_video_crop_right) | Right coordinate (x) of the cropped rectangle. The value type is int32_t. This key is optional and is used only for video decoding.| 124| [OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY](#oh_md_key_video_enable_low_latency) | Enabled status of low-latency video decoding. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and used only in the configuration phase.| 125| [OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR](#oh_md_key_video_decoder_output_enable_vrr) | Whether the decoder enables the video variable frame rate feature. The value type is int32_t. This key is optional and is used only for video decoding.| 126| [OH_MD_KEY_VIDEO_DECODER_BLANK_FRAME_ON_SHUTDOWN](#oh_md_key_video_decoder_blank_frame_on_shutdown) | Whether to output blank frames when the video decoder is disabled. The value type is int32_t. **1** to output, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and is used only for video decoding in surface mode.| 127 128 129Key-value pairs dedicated for audio: 130 131| Name | Description | 132| ------------------------------------------------------------ | ------------------------------------------------------------ | 133| [OH_MD_KEY_AUDIO_SAMPLE_FORMAT](#oh_md_key_audio_sample_format) | Original audio format. The value type is int32_t. For details, see [OH_BitsPerSample](#oh_bitspersample-1).| 134| [OH_MD_KEY_AUD_CHANNEL_COUNT](#oh_md_key_aud_channel_count) | Number of audio channels. The value type is int32_t. | 135| [OH_MD_KEY_AUD_SAMPLE_RATE](#oh_md_key_aud_sample_rate) | Audio sampling rate. The value type is int32_t. | 136| [OH_MD_KEY_AUDIO_COMPRESSION_LEVEL](#oh_md_key_audio_compression_level) | Audio codec compression level. The value type is int32_t type. This key is used only for audio encoding. This key is optional. | 137| [OH_MD_KEY_CHANNEL_LAYOUT](#oh_md_key_channel_layout) | Required encoding channel layout. The value type is int64_t. This key applies only to encoders. For details, see [OH_AudioChannelLayout](_core.md#oh_audiochannellayout-1). | 138| [OH_MD_KEY_BITS_PER_CODED_SAMPLE](#oh_md_key_bits_per_coded_sample) | Number of bits per sample. The value type is int32_t. This key is optional.<br>In versions earlier than API version 20, this parameter must be set to **1** for FLAC encoding. Otherwise, **OH_AudioCodec_Configure** returns the error code **AV_ERR_INVALID_VAL**. However, this parameter has no actual effect and does not affect the encoding result. Starting from API version 20, you do not need to set it anymore.| 139| [OH_MD_KEY_SBR](#oh_md_key_sbr) | AAC SBR format. The value type is int32_t. This key applies to AAC encoders. This key is optional.| 140| [OH_MD_KEY_COMPLIANCE_LEVEL](#oh_md_key_compliance_level) | FLAC compliance level. The value type is int32_t. This key is used only for audio encoding. This key is optional. | 141| [OH_MD_KEY_AAC_IS_ADTS](#oh_md_key_aac_is_adts) | AAC format, which can be ADTS or LATM. The value type is int32_t. This key applies to AAC decoders. This key is optional. | 142| [OH_MD_KEY_IDENTIFICATION_HEADER](#oh_md_key_identification_header) | Vorbis identification header. The value type is uint8_t\*. This key applies only to Vorbis decoders. This key is optional.| 143| [OH_MD_KEY_SETUP_HEADER](#oh_md_key_setup_header) | Vorbis setup header. The value type is uint8_t\*. This key applies only to Vorbis decoders. This key is optional.| 144| [OH_MD_KEY_AUDIO_OBJECT_NUMBER](#oh_md_key_audio_object_number) | Number of audio objects. The value type is int32_t. This key is used only for Audio Vivid decoding. This key is optional. | 145| [OH_MD_KEY_AUDIO_VIVID_METADATA](#oh_md_key_audio_vivid_metadata) | Audio Vivid metadata. The value type is uint8_t\*. This key is used only for Audio Vivid decoding. This key is optional. | 146 147Key-value pairs dedicated for multiplexing and demultiplexing: 148 149| Name | Description | 150| ------------------------------------------------------------ | ------------------------------------------------------------ | 151| [OH_MD_KEY_VIDEO_IS_HDR_VIVID](#oh_md_key_video_is_hdr_vivid) | Whether the video track in a media file is HDR Vivid. The value type is int32_t. This key is used for both multiplexing and demultiplexing. This key is optional. | 152| [OH_MD_KEY_START_TIME](#oh_md_key_start_time) | Start time of the first frame in a media file, measured in microseconds. The value type is int64_t. This key is optional. | 153| [OH_MD_KEY_TRACK_START_TIME](#oh_md_key_track_start_time) | Start time of the track, measured in microseconds. The value type is int64_t. This key is optional. | 154| [OH_MD_KEY_TRACK_TYPE](#oh_md_key_track_type) | Track type in a media file. The value type is int32_t. For details, see [OH_MediaType](#oh_mediatype-1). This key is optional.| 155| [OH_MD_KEY_DURATION](#oh_md_key_duration) | Duration in a media file. The value type is int64_t. This key is optional. | 156| [OH_MD_KEY_TITLE](#oh_md_key_title) | Title in a media file. The value type is string. This key is optional. | 157| [OH_MD_KEY_ARTIST](#oh_md_key_artist) | Artist in a media file. The value type is string. This key is optional. | 158| [OH_MD_KEY_ALBUM](#oh_md_key_album) | Album in a media file. The value type is string. This key is optional. | 159| [OH_MD_KEY_ALBUM_ARTIST](#oh_md_key_album_artist) | Album artist of the input media. The value type is string. This key is optional. | 160| [OH_MD_KEY_DATE](#oh_md_key_date) | Date in a media file, for example, 2024. The value type is string. This key is optional. | 161| [OH_MD_KEY_COMMENT](#oh_md_key_comment) | Comment in a media file. The value type is string. This key is optional. | 162| [OH_MD_KEY_GENRE](#oh_md_key_genre) | Genre in a media file. The value type is string. This key is optional. | 163| [OH_MD_KEY_COPYRIGHT](#oh_md_key_copyright) | Copyright in a media file. The value type is string. This key is optional. | 164| [OH_MD_KEY_LANGUAGE](#oh_md_key_language) | Language in a media file. The value type is string. This key is optional. | 165| [OH_MD_KEY_DESCRIPTION](#oh_md_key_description) | Description in a media file. The value type is string. This key is optional. | 166| [OH_MD_KEY_LYRICS](#oh_md_key_lyrics) | Lyrics in a media file. The value type is string. This key is optional. | 167| [OH_MD_KEY_TRACK_COUNT](#oh_md_key_track_count) | Number of tracks in a media file. The value type is int32_t. This key is optional. | 168| [OH_MD_KEY_BUFFER_DURATION](#oh_md_key_buffer_duration) | Duration corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t. This key is optional. | 169| [OH_MD_KEY_DECODING_TIMESTAMP](#oh_md_key_decoding_timestamp) | Decoding timestamp corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t. This key is optional. | 170| [OH_MD_KEY_CODEC_MIME](#oh_md_key_codec_mime) | [MIME](#media-codec-formats) type of the codec. The value type is string. This key is optional. | 171| [OH_MD_KEY_VIDEO_SAR](#oh_md_key_video_sar) | Aspect ratio of the sample. The value type is double.| 172| [OH_MD_KEY_CREATION_TIME](#oh_md_key_creation_time) | Media file creation time. The value type is string.| 173| [OH_MD_KEY_REFERENCE_TRACK_IDS](#oh_md_key_reference_track_ids) | Reference relationship between media file tracks. The value type is int32_t\*.| 174| [OH_MD_KEY_TRACK_REFERENCE_TYPE](#oh_md_key_track_reference_type) | Auxiliary track type of a media file. The value type is string.| 175| [OH_MD_KEY_TRACK_DESCRIPTION](#oh_md_key_track_description) | Auxiliary track description of a media file. The value type is string.| 176| [OH_MD_KEY_ENABLE_MOOV_FRONT](#oh_md_key_enable_moov_front) | Whether the moov metadata should be at the front of a media file. The value type is int32_t.| 177 178 179## Summary 180 181 182### Files 183 184| Name| Description| 185| -------- | -------- | 186| [avcodec_audio_channel_layout.h](avcodec__audio__channel__layout_8h.md) | Declares the enums used for audio encoding and decoding.| 187| [native_avcodec_base.h](native__avcodec__base_8h.md) | Declares the native APIs used for basic audio and video multiplexing, demultiplexing, encoding, and decoding.| 188 189 190### Structs 191 192| Name| Description| 193| -------- | -------- | 194| struct [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) | Describes all the asynchronous callback function pointers of an OH_AVCodec instance. (It is deprecated from API version 11.)| 195| struct [OH_AVCodecCallback](_o_h___a_v_codec_callback.md) | Describes all the asynchronous callback function pointers of an OH_AVCodec instance.| 196| struct [OH_AVDataSource](_o_h___a_v_data_source.md) | Describes a user-defined data source. | 197 198 199### Types 200 201| Name| Description| 202| -------- | -------- | 203| typedef struct NativeWindow [OHNativeWindow](#ohnativewindow) | Defines a struct for a native object for the graphics interface. | 204| typedef struct [OH_AVCodec](#oh_avcodec) [OH_AVCodec](#oh_avcodec) | Defines a struct for a native object for the audio and video codec interface. | 205| typedef void(\* [OH_AVCodecOnError](#oh_avcodeconerror)) ([OH_AVCodec](#oh_avcodec) \*codec, int32_t errorCode, void \*userData) | Defines the pointer to the function that is called to report error information when an error occurs during the running of an OH_AVCodec instance.| 206| typedef void(\* [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged)) ([OH_AVCodec](#oh_avcodec) \*codec, [OH_AVFormat](_core.md#oh_avformat) \*format, void \*userData) | Defines the pointer to the function that is called to report the new stream description when the resolution of the input video stream being decoded or the output video stream that has been encoded changes.<br>From API version 15, this function pointer is called to report the new stream description when the stream sampling rate, number of audio channels, or audio sampling format changes during audio decoding. The decoding formats that can detect these changes include <!--RP3--><!--RP3End-->AAC, FLAC, MP3, and VORBIS.| 207| typedef void(\* [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata)) ([OH_AVCodec](#oh_avcodec) \*codec, uint32_t index, [OH_AVMemory](_core.md#oh_avmemory) \*data, void \*userData) | Defines the pointer to the function that is called when new input data is required during the running of an OH_AVCodec instance. The function carries a buffer to fill in new input data. (It is deprecated from API version 11.)| 208| typedef void(\* [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata)) ([OH_AVCodec](#oh_avcodec) \*codec, uint32_t index, [OH_AVMemory](_core.md#oh_avmemory) \*data, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) \*attr, void \*userData) | Defines the pointer to the function that is called when new output data is generated during the running of an OH_AVCodec instance. The function carries a buffer filled with new output data. (It is deprecated from API version 11.)| 209| typedef void(\* [OH_AVCodecOnNeedInputBuffer](#oh_avcodeconneedinputbuffer)) ([OH_AVCodec](#oh_avcodec) \*codec, uint32_t index, [OH_AVBuffer](_core.md#oh_avbuffer) \*buffer, void \*userData) | Defines the pointer to the function that is called when new input data is required during the running of an OH_AVCodec instance. The function carries a buffer to fill in new input data.| 210| typedef void(\* [OH_AVCodecOnNewOutputBuffer](#oh_avcodeconnewoutputbuffer)) ([OH_AVCodec](#oh_avcodec) \*codec, uint32_t index, [OH_AVBuffer](_core.md#oh_avbuffer) \*buffer, void \*userData) | Defines the pointer to the function that is called when new output data is generated during the running of an OH_AVCodec instance. The function carries a buffer filled with new output data.| 211| typedef struct [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) [OH_AVCodecAsyncCallback](#oh_avcodecasynccallback) | Defines all the asynchronous callback function pointers of an OH_AVCodec instance. (It is deprecated from API version 11.)| 212| typedef struct [OH_AVCodecCallback](_o_h___a_v_codec_callback.md) [OH_AVCodecCallback](#oh_avcodeccallback) | Defines all the asynchronous callback function pointers of an OH_AVCodec instance.| 213| typedef int32_t(\* [OH_AVDataSourceReadAt](#oh_avdatasourcereadat)) (OH_AVBuffer \*data, int32_t length, int64_t pos) | Defines a function pointer used to provide the capability of obtaining user-defined media data. | 214| typedef int32_t(\* [OH_AVDataSourceReadAtExt](#oh_avdatasourcereadatext)) (OH_AVBuffer \*data, int32_t length, int64_t pos, void *userData) | Defines a function pointer used to provide the capability of obtaining user-defined media data. User-defined data can be passed to its callback functions through the **userData** parameter. | 215| typedef struct [OH_AVDataSource](_o_h___a_v_data_source.md) [OH_AVDataSource](#oh_avdatasource) | Defines a struct for a user-defined data source. | 216| typedef enum [OH_MediaType](#oh_mediatype-1) [OH_MediaType](#oh_mediatype) | Defines an enum for the media types.| 217| typedef enum [OH_AACProfile](#oh_aacprofile-1) [OH_AACProfile](#oh_aacprofile) | Defines an enum for the Advanced Audio Coding (AAC) profiles.| 218| typedef enum [OH_AVCProfile](#oh_avcprofile-1) [OH_AVCProfile](#oh_avcprofile) | Defines an enum for the Advanced Video Coding (AVC) profiles.| 219| typedef enum [OH_HEVCProfile](#oh_hevcprofile-1) [OH_HEVCProfile](#oh_hevcprofile) | Defines an enum for the High Efficiency Video Coding (HEVC) profiles.| 220| typedef enum [OH_VVCProfile](#oh_vvcprofile-1) [OH_VVCProfile](#oh_vvcprofile) | Defines an enum for the VVC profiles.| 221| typedef enum [OH_H263Profile](#oh_h263profile-1) [OH_H263Profile](#oh_h263profile) | Defines an enum for the H.263 profiles.| 222| typedef enum [OH_MPEG2Profile](#oh_mpeg2profile-1) [OH_MPEG2Profile](#oh_mpeg2profile) | Defines an enum for the MPEG2 profiles.| 223| typedef enum [OH_MPEG4Profile](#oh_mpeg4profile-1) [OH_MPEG4Profile](#oh_mpeg4profile) | Defines an enum for the MPEG4 profiles.| 224| typedef enum [OH_AVOutputFormat](#oh_avoutputformat-1) [OH_AVOutputFormat](#oh_avoutputformat) | Defines an enum for the output file formats supported by a muxer.| 225| typedef enum [OH_AVSeekMode](#oh_avseekmode-1) [OH_AVSeekMode](#oh_avseekmode) | Defines an enum for the seek modes.| 226| typedef enum [OH_ScalingMode](#oh_scalingmode-1) [OH_ScalingMode](#oh_scalingmode) | Defines an enum for the scaling modes. This enum is used only in surface mode. (It is deprecated from API version 14.)| 227| typedef enum [OH_BitsPerSample](#oh_bitspersample-1) [OH_BitsPerSample](#oh_bitspersample) | Defines an enum for the number of audio bits for each coded sample.| 228| typedef enum [OH_ColorPrimary](#oh_colorprimary-1) [OH_ColorPrimary](#oh_colorprimary) | Defines an enum for the primary colors.| 229| typedef enum [OH_TransferCharacteristic](#oh_transfercharacteristic-1) [OH_TransferCharacteristic](#oh_transfercharacteristic) | Defines an enum for the transfer characteristics.| 230| typedef enum [OH_MatrixCoefficient](#oh_matrixcoefficient-1) [OH_MatrixCoefficient](#oh_matrixcoefficient) | Defines an enum for the matrix coefficients.| 231| typedef enum [OH_AVCLevel](#oh_avclevel-1) [OH_AVCLevel](#oh_avclevel) | Defines an enum for the AVC levels. | 232| typedef enum [OH_HEVCLevel](#oh_hevclevel-1) [OH_HEVCLevel](#oh_hevclevel) | Defines an enum for the HEVC levels. | 233| typedef enum [OH_VVCLevel](#oh_vvclevel-1) [OH_VVCLevel](#oh_vvclevel) | Defines an enum for the VVC levels. | 234| typedef enum [OH_H263Level ](#oh_h263level-1) [OH_H263Level ](#oh_h263level) | Defines an enum for the H.263 levels. | 235| typedef enum [OH_MPEG2Level](#oh_mpeg2level-1) [OH_MPEG2Level](#oh_mpeg2level) | Defines an enum for the MPEG2 levels.| 236| typedef enum [OH_MPEG4Level](#oh_mpeg4level-1) [OH_MPEG4Level](#oh_mpeg4level) | Defines an enum for the MPEG4 levels.| 237| typedef enum [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode-1) [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode) | Defines an enum for the reference modes of temporal image groups. | 238| typedef enum [OH_BitrateMode](#oh_bitratemode-1) [OH_BitrateMode](#oh_bitratemode) | Defines an enum for the bit rate modes of an encoder. | 239 240 241### Enums 242 243| Name| Description| 244| -------- | -------- | 245| [AudioChannelSet](#audiochannelset) : uint64_t {<br>FRONT_LEFT = 1ULL << 0U,<br>FRONT_RIGHT = 1ULL << 1U,<br>FRONT_CENTER = 1ULL << 2U,<br>LOW_FREQUENCY = 1ULL << 3U,<br>BACK_LEFT = 1ULL << 4U,<br>BACK_RIGHT = 1ULL << 5U,<br>FRONT_LEFT_OF_CENTER = 1ULL << 6U,<br>FRONT_RIGHT_OF_CENTER = 1ULL << 7U,<br>BACK_CENTER = 1ULL << 8U,<br>SIDE_LEFT = 1ULL << 9U,<br>SIDE_RIGHT = 1ULL << 10U,<br>TOP_CENTER = 1ULL << 11U,<br>TOP_FRONT_LEFT = 1ULL << 12U,<br>TOP_FRONT_CENTER = 1ULL << 13U,<br>TOP_FRONT_RIGHT = 1ULL << 14U,<br>TOP_BACK_LEFT = 1ULL << 15U,<br>TOP_BACK_CENTER = 1ULL << 16U,<br>TOP_BACK_RIGHT = 1ULL << 17U,<br>STEREO_LEFT = 1ULL << 29U,<br>STEREO_RIGHT = 1ULL << 30U,<br>WIDE_LEFT = 1ULL << 31U,<br>WIDE_RIGHT = 1ULL << 32U,<br>SURROUND_DIRECT_LEFT = 1ULL << 33U,<br>SURROUND_DIRECT_RIGHT = 1ULL << 34U,<br>LOW_FREQUENCY_2 = 1ULL << 35U,<br>TOP_SIDE_LEFT = 1ULL << 36U,<br>TOP_SIDE_RIGHT = 1ULL << 37U,<br>BOTTOM_FRONT_CENTER = 1ULL << 38U,<br>BOTTOM_FRONT_LEFT = 1ULL << 39U,<br>BOTTOM_FRONT_RIGHT = 1ULL << 40U,<br>AMBISONICS_ACN0 = 1ULL << 41U,<br>AMBISONICS_ACN1 = 1ULL << 42U,<br>AMBISONICS_ACN2 = 1ULL << 43U,<br>AMBISONICS_ACN3 = 1ULL << 44U,<br>AMBISONICS_W = AMBISONICS_ACN0,<br>AMBISONICS_Y = AMBISONICS_ACN1,<br>AMBISONICS_Z = AMBISONICS_ACN2,<br>AMBISONICS_X = AMBISONICS_ACN3,<br>AMBISONICS_ACN4 = 1ULL << 45U,<br>AMBISONICS_ACN5 = 1ULL << 46U,<br>AMBISONICS_ACN6 = 1ULL << 47U,<br>AMBISONICS_ACN7 = 1ULL << 48U,<br>AMBISONICS_ACN8 = 1ULL << 49U,<br>AMBISONICS_ACN9 = 1ULL << 50U,<br>AMBISONICS_ACN10 = 1ULL << 51U,<br>AMBISONICS_ACN11 = 1ULL << 52U,<br>AMBISONICS_ACN12 = 1ULL << 53U,<br>AMBISONICS_ACN13 = 1ULL << 54U,<br>AMBISONICS_ACN14 = 1ULL << 55U,<br>AMBISONICS_ACN15 = 1ULL << 56U<br>} | Enumerates the audio channels. Each channel is mapped to a variable of int64_t. (It is deprecated from API version 11.)| 246| [AudioChannelLayout](#audiochannellayout) : uint64_t {<br>UNKNOWN_CHANNEL_LAYOUT = 0,<br>MONO = (AudioChannelSet::FRONT_CENTER),<br>STEREO = (AudioChannelSet::FRONT_LEFT \| AudioChannelSet::FRONT_RIGHT),<br>CH_2POINT1 = (STEREO \| AudioChannelSet::LOW_FREQUENCY),<br>CH_2_1 = (STEREO \| AudioChannelSet::BACK_CENTER),<br>SURROUND = (STEREO \| AudioChannelSet::FRONT_CENTER),<br>CH_3POINT1 = (SURROUND \| AudioChannelSet::LOW_FREQUENCY),<br>CH_4POINT0 = (SURROUND \| AudioChannelSet::BACK_CENTER),<br>CH_4POINT1 = (CH_4POINT0 \| AudioChannelSet::LOW_FREQUENCY),<br>CH_2_2 = (STEREO \| AudioChannelSet::SIDE_LEFT \| AudioChannelSet::SIDE_RIGHT),<br>QUAD = (STEREO \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT),<br>CH_5POINT0 = (SURROUND \| AudioChannelSet::SIDE_LEFT \| AudioChannelSet::SIDE_RIGHT),<br>CH_5POINT1 = (CH_5POINT0 \| AudioChannelSet::LOW_FREQUENCY),<br>CH_5POINT0_BACK = (SURROUND \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT),<br>CH_5POINT1_BACK = (CH_5POINT0_BACK \| AudioChannelSet::LOW_FREQUENCY),<br>CH_6POINT0 = (CH_5POINT0 \| AudioChannelSet::BACK_CENTER),<br>CH_6POINT0_FRONT = (CH_2_2 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER),<br>HEXAGONAL = (CH_5POINT0_BACK \| AudioChannelSet::BACK_CENTER),<br>CH_6POINT1 = (CH_5POINT1 \| AudioChannelSet::BACK_CENTER),<br>CH_6POINT1_BACK = (CH_5POINT1_BACK \| AudioChannelSet::BACK_CENTER),<br>CH_6POINT1_FRONT = (CH_6POINT0_FRONT \| AudioChannelSet::LOW_FREQUENCY),<br>CH_7POINT0 = (CH_5POINT0 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT),<br>CH_7POINT0_FRONT = (CH_5POINT0 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER),<br>CH_7POINT1 = (CH_5POINT1 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT),<br>CH_7POINT1_WIDE = (CH_5POINT1 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER),<br>CH_7POINT1_WIDE_BACK, CH_3POINT1POINT2 = (CH_3POINT1 \| AudioChannelSet::TOP_FRONT_LEFT \| AudioChannelSet::TOP_FRONT_RIGHT),<br>CH_5POINT1POINT2 = (CH_5POINT1 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT),<br>CH_5POINT1POINT4, CH_7POINT1POINT2 = (CH_7POINT1 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT),<br>CH_7POINT1POINT4, CH_9POINT1POINT4 = (CH_7POINT1POINT4 \| AudioChannelSet::WIDE_LEFT \| AudioChannelSet::WIDE_RIGHT),<br>CH_9POINT1POINT6 = (CH_9POINT1POINT4 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT),<br>CH_10POINT2, CH_22POINT2, OCTAGONAL = (CH_5POINT0 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_CENTER \| AudioChannelSet::BACK_RIGHT),<br>HEXADECAGONAL, STEREO_DOWNMIX = (AudioChannelSet::STEREO_LEFT \| AudioChannelSet::STEREO_RIGHT),<br>HOA_FIRST,<br>HOA_SECOND,<br>HOA_THIRD<br>} | Enumerates the layouts of audio channels. The output format of the decoder is described using the channel layout of the codec. (It is deprecated from API version 11.)| 247| [OH_MediaType](#oh_mediatype-1) {<br>MEDIA_TYPE_AUD = 0,<br>MEDIA_TYPE_VID = 1,<br>MEDIA_TYPE_SUBTITLE = 2,<br>MEDIA_TYPE_TIMED_METADATA = 5,<br>MEDIA_TYPE_AUXILIARY = 6<br>} | Enumerates the media types.| 248| [OH_AACProfile](#oh_aacprofile-1) {<br>AAC_PROFILE_LC = 0,<br>AAC_PROFILE_HE = 3,<br>AAC_PROFILE_HE_V2 = 4<br>} | Enumerates the AAC profiles.<!--Del--><br>(**AAC_PROFILE_HE** and **AAC_PROFILE_HE_V2** are not available yet.)<!--DelEnd--> | 249| [OH_AVCProfile](#oh_avcprofile-1) {<br>AVC_PROFILE_BASELINE = 0,<br>AVC_PROFILE_HIGH = 4,<br>AVC_PROFILE_MAIN = 8<br>} | Enumerates the AVC profiles.| 250| [OH_HEVCProfile](#oh_hevcprofile-1) {<br>HEVC_PROFILE_MAIN = 0,<br>HEVC_PROFILE_MAIN_10 = 1,<br>HEVC_PROFILE_MAIN_STILL = 2,<br>HEVC_PROFILE_MAIN_10_HDR10 = 3,<br>HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4<br>} | Enumerates the HEVC profiles.<br>(**HEVC_PROFILE_MAIN_10_HDR10** and **HEVC_PROFILE_MAIN_10_HDR10_PLUS** are deprecated from API version 14.)| 251| [OH_VVCProfile](#oh_vvcprofile-1) {<br>VVC_PROFILE_MAIN_10 = 1, <br>VVC_PROFILE_MAIN_12 = 2, <br>VVC_PROFILE_MAIN_12_INTRA = 10, <br>VVC_PROFILE_MULTI_MAIN_10 = 17, <br>VVC_PROFILE_MAIN_10_444 = 33, <br>VVC_PROFILE_MAIN_12_444 = 34, <br>VVC_PROFILE_MAIN_16_444 = 36, <br>VVC_PROFILE_MAIN_12_444_INTRA = 42, <br>VVC_PROFILE_MAIN_16_444_INTRA = 44, <br>VVC_PROFILE_MULTI_MAIN_10_444 = 49, <br>VVC_PROFILE_MAIN_10_STILL = 65, <br>VVC_PROFILE_MAIN_12_STILL = 66, <br>VVC_PROFILE_MAIN_10_444_STILL = 97, <br>VVC_PROFILE_MAIN_12_444_STILL = 98, <br>VVC_PROFILE_MAIN_16_444_STILL = 100 <br>} | Enumerates the VVC profiles.| 252| [OH_H263Profile](#oh_h263profile-1) {<br>H263_PROFILE_BASELINE = 0,<br>H263_PROFILE_VERSION_1_BACKWARD_COMPATIBILITY = 2<br>} | Enumerates the H.263 profiles.| 253| [OH_MPEG2Profile](#oh_mpeg2profile-1) {<br>MPEG2_PROFILE_SIMPLE = 0,<br>MPEG2_PROFILE_MAIN = 1,<br>MPEG2_PROFILE_SNR = 2,<br>MPEG2_PROFILE_SPATIAL = 3,<br>MPEG2_PROFILE_HIGH = 4,<br>MPEG2_PROFILE_422 = 5<br>} | Enumerates the MPEG2 profiles.| 254| [OH_MPEG4Profile](#oh_mpeg4profile-1) {<br>MPEG4_PROFILE_SIMPLE = 0,<br>MPEG4_PROFILE_SIMPLE_SCALABLE = 1,<br>MPEG4_PROFILE_CORE = 2,<br>MPEG4_PROFILE_MAIN = 3,<br>MPEG4_PROFILE_NBIT = 4,<br>MPEG4_PROFILE_HYBRID = 5,<br>MPEG4_PROFILE_BASIC_ANIMATED_TEXTURE = 6,<br>MPEG4_PROFILE_SCALABLE_TEXTURE = 7,<br>MPEG4_PROFILE_SIMPLE_FA = 8,<br>MPEG4_PROFILE_ADVANCED_REAL_TIME_SIMPLE = 9,<br>MPEG4_PROFILE_CORE_SCALABLE = 10,<br>MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 11,<br>MPEG4_PROFILE_ADVANCED_CORE = 12,<br>MPEG4_PROFILE_ADVANCED_SCALABLE_TEXTURE = 13,<br>MPEG4_PROFILE_ADVANCED_SIMPLE = 17<br>} | Enumerates the MPEG4 profiles.| 255| [OH_AVOutputFormat](#oh_avoutputformat-1) {<br>AV_OUTPUT_FORMAT_DEFAULT = 0,<br>AV_OUTPUT_FORMAT_MPEG_4 = 2,<br>AV_OUTPUT_FORMAT_M4A = 6,<br>AV_OUTPUT_FORMAT_AMR = 8,<br>AV_OUTPUT_FORMAT_MP3 = 9,<br>AV_OUTPUT_FORMAT_WAV = 10, <br>AV_OUTPUT_FORMAT_AAC = 11,<br>AV_OUTPUT_FORMAT_FLAC = 12<br>} | Enumerates the output file formats supported by a muxer.| 256| [OH_AVSeekMode](#oh_avseekmode-1) {<br>SEEK_MODE_NEXT_SYNC = 0,<br>SEEK_MODE_PREVIOUS_SYNC,<br>SEEK_MODE_CLOSEST_SYNC<br>} | Enumerates the seek modes.| 257| [OH_ScalingMode](#oh_scalingmode-1) {<br>SCALING_MODE_SCALE_TO_WINDOW = 1,<br>SCALING_MODE_SCALE_CROP = 2<br>} | Enumerates the scaling modes. (It is deprecated from API version 14.)| 258| [OH_BitsPerSample](#oh_bitspersample-1) {<br>SAMPLE_U8 = 0, SAMPLE_S16LE = 1,<br>SAMPLE_S24LE = 2, SAMPLE_S32LE = 3,<br>SAMPLE_F32LE = 4, SAMPLE_U8P = 5,<br>SAMPLE_S16P = 6, SAMPLE_S24P = 7,<br>SAMPLE_S32P = 8, SAMPLE_F32P = 9,<br>INVALID_WIDTH = -1<br>} | Enumerates the number of audio bits for each coded sample.| 259| [OH_ColorPrimary](#oh_colorprimary-1) {<br>COLOR_PRIMARY_BT709 = 1,<br>COLOR_PRIMARY_UNSPECIFIED = 2,<br>COLOR_PRIMARY_BT470_M = 4,<br>COLOR_PRIMARY_BT601_625 = 5,<br>COLOR_PRIMARY_BT601_525 = 6,<br>COLOR_PRIMARY_SMPTE_ST240 = 7,<br>COLOR_PRIMARY_GENERIC_FILM = 8,<br>COLOR_PRIMARY_BT2020 = 9,<br>COLOR_PRIMARY_SMPTE_ST428 = 10,<br>COLOR_PRIMARY_P3DCI = 11,<br>COLOR_PRIMARY_P3D65 = 12<br>} | Enumerates the primary colors.| 260| [OH_TransferCharacteristic](#oh_transfercharacteristic-1) {<br>TRANSFER_CHARACTERISTIC_BT709 = 1,<br>TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2,<br>TRANSFER_CHARACTERISTIC_GAMMA_2_2 = 4,<br>TRANSFER_CHARACTERISTIC_GAMMA_2_8 = 5,<br>TRANSFER_CHARACTERISTIC_BT601 = 6,<br>TRANSFER_CHARACTERISTIC_SMPTE_ST240 = 7,<br>TRANSFER_CHARACTERISTIC_LINEAR = 8,<br>TRANSFER_CHARACTERISTIC_LOG = 9,<br>TRANSFER_CHARACTERISTIC_LOG_SQRT = 10,<br>TRANSFER_CHARACTERISTIC_IEC_61966_2_4 = 11,<br>TRANSFER_CHARACTERISTIC_BT1361 = 12,<br>TRANSFER_CHARACTERISTIC_IEC_61966_2_1 = 13,<br>TRANSFER_CHARACTERISTIC_BT2020_10BIT = 14,<br>TRANSFER_CHARACTERISTIC_BT2020_12BIT = 15,<br>TRANSFER_CHARACTERISTIC_PQ = 16,<br>TRANSFER_CHARACTERISTIC_SMPTE_ST428 = 17,<br>TRANSFER_CHARACTERISTIC_HLG = 18<br>} | Enumerates the transfer characteristics.| 261| [OH_MatrixCoefficient](#oh_matrixcoefficient-1) {<br>MATRIX_COEFFICIENT_IDENTITY = 0,<br>MATRIX_COEFFICIENT_BT709 = 1,<br>MATRIX_COEFFICIENT_UNSPECIFIED = 2,<br>MATRIX_COEFFICIENT_FCC = 4,<br>MATRIX_COEFFICIENT_BT601_625 = 5,<br>MATRIX_COEFFICIENT_BT601_525 = 6, MATRIX_COEFFICIENT_SMPTE_ST240 = 7,<br>MATRIX_COEFFICIENT_YCGCO = 8,<br>MATRIX_COEFFICIENT_BT2020_NCL = 9,<br>MATRIX_COEFFICIENT_BT2020_CL = 10,<br>MATRIX_COEFFICIENT_SMPTE_ST2085 = 11,<br>MATRIX_COEFFICIENT_CHROMATICITY_NCL = 12,<br>MATRIX_COEFFICIENT_CHROMATICITY_CL = 13,<br>MATRIX_COEFFICIENT_ICTCP = 14<br>} | Enumerates the matrix coefficients.| 262| [OH_AVCLevel](#oh_avclevel-1) {<br>AVC_LEVEL_1 = 0, <br>AVC_LEVEL_1b = 1, <br>AVC_LEVEL_11 = 2, <br>AVC_LEVEL_12 = 3,<br>AVC_LEVEL_13 = 4, <br>AVC_LEVEL_2 = 5, <br>AVC_LEVEL_21 = 6, <br>AVC_LEVEL_22 = 7,<br>AVC_LEVEL_3 = 8, <br>AVC_LEVEL_31 = 9, <br>AVC_LEVEL_32 = 10, <br>AVC_LEVEL_4 = 11,<br>AVC_LEVEL_41 = 12, <br>AVC_LEVEL_42 = 13, <br>AVC_LEVEL_5 = 14, <br>AVC_LEVEL_51 = 15, <br>AVC_LEVEL_52 = 16, <br>AVC_LEVEL_6 = 17, <br>AVC_LEVEL_61 = 18, <br>AVC_LEVEL_62 = 19<br>} | Enumerates the AVC levels. | 263| [OH_HEVCLevel](#oh_hevclevel-1) {<br>HEVC_LEVEL_1 = 0, <br>HEVC_LEVEL_2 = 1, <br>HEVC_LEVEL_21 = 2, <br>HEVC_LEVEL_3 = 3,<br>HEVC_LEVEL_31 = 4, <br>HEVC_LEVEL_4 = 5, <br>HEVC_LEVEL_41 = 6, <br>HEVC_LEVEL_5 = 7,<br>HEVC_LEVEL_51 = 8, <br>HEVC_LEVEL_52 = 9, <br>HEVC_LEVEL_6 = 10, <br>HEVC_LEVEL_61 = 11,<br>HEVC_LEVEL_62 = 12<br>} | Enumerates the HEVC levels. | 264| [OH_VVCLevel](#oh_vvclevel-1) {<br>VVC_LEVEL_1 = 16, <br>VVC_LEVEL_2 = 32, <br>VVC_LEVEL_21 = 35, <br>VVC_LEVEL_3 = 48, <br>VVC_LEVEL_31 = 51, <br>VVC_LEVEL_4 = 64, <br>VVC_LEVEL_41 = 67, <br>VVC_LEVEL_5 = 80, <br>VVC_LEVEL_51 = 83, <br>VVC_LEVEL_52 = 86, <br>VVC_LEVEL_6 = 96, <br>VVC_LEVEL_61 = 99, <br>VVC_LEVEL_62 = 102, <br>VVC_LEVEL_63 = 105, <br>VVC_LEVEL_155 = 255<br>} | Enumerates the VVC levels. | 265| [OH_H263Level ](#oh_h263level-1) {<br>H263_LEVEL_10 = 0, <br>H263_LEVEL_20 = 1, <br>H263_LEVEL_30 = 2, <br>H263_LEVEL_40 = 3, <br>H263_LEVEL_45 = 4, <br>H263_LEVEL_50 = 5, <br>H263_LEVEL_60 = 6, <br>H263_LEVEL_70 = 7<br>} | Enumerates the H.263 levels. | 266| [OH_MPEG2Level](#oh_mpeg2level-1) {<br>MPEG2_LEVEL_LL = 0,<br>MPEG2_LEVEL_ML = 1,<br>MPEG2_LEVEL_H14 = 2,<br>MPEG2_LEVEL_HL = 3<br> } | Enumerates the MPEG2 levels.| 267| [OH_MPEG4Level](#oh_mpeg4level-1) {<br>MPEG4_LEVEL_0 = 0,<br>MPEG4_LEVEL_0B = 1,<br>MPEG4_LEVEL_1 = 2,<br>MPEG4_LEVEL_2 = 3,<br>MPEG4_LEVEL_3 = 4,<br>MPEG4_LEVEL_3B = 5,<br>MPEG4_LEVEL_4 = 6,<br>MPEG4_LEVEL_4A = 7,<br>MPEG4_LEVEL_5 = 8,<br>MPEG4_LEVEL_6 = 9<br>} | Enumerates the MPEG4 levels.| 268| [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode-1) { <br>ADJACENT_REFERENCE = 0, <br>JUMP_REFERENCE = 1, <br>UNIFORMLY_SCALED_REFERENCE = 2 <br>} | Enumerates the reference modes of temporal image groups. | 269| [OH_BitrateMode](#oh_bitratemode-1) { <br>BITRATE_MODE_CBR = 0, <br>BITRATE_MODE_VBR = 1, <br>BITRATE_MODE_CQ = 2, <br>BITRATE_MODE_SQR = 3<br> } | Enumerates the bit rate modes of an encoder. | 270 271### Variables 272 273| Name| Description| 274| -------- | -------- | 275| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_AAC](#oh_avcodec_mimetype_audio_aac) | Pointer to the key that describes the MIME type of the AAC audio codec.| 276| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_FLAC](#oh_avcodec_mimetype_audio_flac) | Pointer to the key that describes the MIME type of the FLAC audio codec.| 277| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_OPUS](#oh_avcodec_mimetype_audio_opus) | Pointer to the key that describes the MIME type of the Opus audio codec. <!--Del-->(This specification is not available yet.)<!--DelEnd--> | 278| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_G711MU](#oh_avcodec_mimetype_audio_g711mu) | Pointer to the key that describes the MIME type of the G.711 mu-law audio codec.| 279| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_G711A](#oh_avcodec_mimetype_audio_g711a) | Pointer to the key that describes the MIME type of the G.711 a-law audio decoder.| 280| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_VORBIS](#oh_avcodec_mimetype_audio_vorbis) | Pointer to the key that describes the MIME type of the Vorbis audio decoder.| 281| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_MPEG](#oh_avcodec_mimetype_audio_mpeg) | Pointer to the key that describes the MIME type of the MP3 audio codec.| 282| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_VIVID](#oh_avcodec_mimetype_audio_vivid) | Pointer to the key that describes the MIME type of the Audio Vivid audio decoder. <!--Del-->(This specification is not available yet.)<!--DelEnd--> | 283| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB](#oh_avcodec_mimetype_audio_amr_nb) | Pointer to the key that describes the MIME type of the AMR-NB audio decoder.| 284| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB](#oh_avcodec_mimetype_audio_amr_wb) | Pointer to the key that describes the MIME type of the AMR-WB audio decoder.| 285| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_APE](#oh_avcodec_mimetype_audio_ape) |Pointer to the key that describes the MIME type of the APE audio decoder. | 286| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_VVC](#oh_avcodec_mimetype_video_vvc) | Pointer to the key that describes the MIME type of the VVC (H.266) video codec.| 287| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_HEVC](#oh_avcodec_mimetype_video_hevc) | Pointer to the key that describes the MIME type of the HEVC (H.265) video codec.| 288| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_AVC](#oh_avcodec_mimetype_video_avc) | Pointer to the key that describes the MIME type of the AVC (H.264) video codec.| 289| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_H263](#oh_avcodec_mimetype_video_h263) | Pointer to the key that describes the MIME type of the H.263 video codec. | 290| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_MPEG4](#oh_avcodec_mimetype_video_mpeg4) | Pointer to the key that describes the MIME type of the MPEG4 video encoder, which is used only for multiplexing MPEG4 video streams. (It is deprecated from API version 11.)| 291| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_MPEG2](#oh_avcodec_mimetype_video_mpeg2) | Pointer to the key that describes the MIME type of MPEG2 video codec. | 292| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_MPEG4_PART2](#oh_avcodec_mimetype_video_mpeg4_part2) | Pointer to the key that describes the MIME type of MPEG4 Part 2 video codec. | 293| const char \* [OH_AVCODEC_MIMETYPE_IMAGE_JPG](#oh_avcodec_mimetype_image_jpg) | Pointer to the key that describes the MIME type of the JPG image encoder, which is used only for multiplexing JPG covers.| 294| const char \* [OH_AVCODEC_MIMETYPE_IMAGE_PNG](#oh_avcodec_mimetype_image_png) | Pointer to the key that describes the MIME type of the PNG image encoder, which is used only for multiplexing PNG covers.| 295| const char \* [OH_AVCODEC_MIMETYPE_IMAGE_BMP](#oh_avcodec_mimetype_image_bmp) | Pointer to the key that describes the MIME type of the BMP image encoder, which is used only for multiplexing BMP covers.| 296| const char \* [OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT](#oh_avcodec_mimetype_subtitle_webvtt) |Pointer to the key that describes the MIME type of the WEBVTT subtitle demuxer. | 297| const char \* [OH_AVCODEC_MIMETYPE_SUBTITLE_SRT](#oh_avcodec_mimetype_subtitle_srt) |Pointer to the key that describes the MIME type of the SRT subtitle demuxer. | 298| const char \* [OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT](#oh_feature_property_key_video_encoder_max_ltr_frame_count) | Pointer to the key that describes the maximum number of LTR frames obtained during video encoding. The value type is int32_t. | 299| const char \* [OH_MD_KEY_CODEC_CONFIG](#oh_md_key_codec_config) | Pointer to the key that describes codec-specific data. In the case of video, data carried in **SPS/PPS** is transferred. In the case of audio, data carried in **extraData** is transferred. The value type is uint8_t\*. <!--Del-->(This key is not supported yet for the video codec.)<!--DelEnd--> | 300| const char \* [OH_MD_MAX_INPUT_BUFFER_COUNT](#oh_md_max_input_buffer_count) | Pointer to the key that describes the maximum number of input buffers. The value type is int32_t.| 301| const char \* [OH_MD_MAX_OUTPUT_BUFFER_COUNT](#oh_md_max_output_buffer_count) | Pointer to the key that describes the maximum number of output buffers. The value type is int32_t.| 302| const char \* [OH_MD_KEY_BITRATE](#oh_md_key_bitrate) | Pointer to the key that describes the bit rate. The value type is int64_t.| 303| const char \* [OH_MD_KEY_PROFILE](#oh_md_key_profile) | Pointer to the key that describes the encoding grading. The value type is int32_t. For details, see [OH_AVCProfile](#oh_avcprofile), [OH_HEVCProfile](#oh_hevcprofile), and [OH_AACProfile](#oh_aacprofile).| 304| const char \* [OH_MD_KEY_MAX_INPUT_SIZE](#oh_md_key_max_input_size) | Pointer to the key that describes the maximum size of an input stream to decode. The value type is int32_t.| 305| const char \* [OH_ED_KEY_TIME_STAMP](#oh_ed_key_time_stamp) | Pointer to the key that describes the surface buffer timestamp. The value is of the int64_t type. (It is deprecated from API version 14.)| 306| const char \* [OH_ED_KEY_EOS](#oh_ed_key_eos) | Pointer to the key that describes the end of stream for the surface buffer. The value type is int32_t. (It is deprecated from API version 14.)| 307| const char \* [OH_MD_KEY_WIDTH](#oh_md_key_width) | Pointer to the key that describes the video width. The value type is int32_t.| 308| const char \* [OH_MD_KEY_HEIGHT](#oh_md_key_height) | Pointer to the key that describes the video height. The value type is int32_t.| 309| const char \* [OH_MD_KEY_PIXEL_FORMAT](#oh_md_key_pixel_format) | Pointer to the key that describes the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).| 310| const char \* [OH_MD_KEY_FRAME_RATE](#oh_md_key_frame_rate) | Pointer to the key that describes the video frame rate. The value type is double.| 311| const char \* [OH_MD_KEY_ROTATION](#oh_md_key_rotation) | Pointer to the key that describes the rotation angle of the surface. The value type is int32_t, and the value range is {0, 90, 180, 270}. The default value is 0. This key is used only for video decoding in surface mode.| 312| const char \* [OH_MD_KEY_RANGE_FLAG](#oh_md_key_range_flag) | Pointer to the key that describes the video YUV value range flag. The value type is int32_t. The value **1** means a full range, and **0** means a limited range.| 313| const char \* [OH_MD_KEY_COLOR_PRIMARIES](#oh_md_key_color_primaries) | Pointer to the key that describes the video primary colors. The value type is int32_t. For details, see [OH_ColorPrimary](#oh_colorprimary). The value complies with Table 2 in H.273.| 314| const char \* [OH_MD_KEY_TRANSFER_CHARACTERISTICS](#oh_md_key_transfer_characteristics) | Pointer to the key that describes the video transfer characteristics. The value type is int32_t. For details, see [OH_TransferCharacteristic](#oh_transfercharacteristic). The value complies with Table 4 in H.273.| 315| const char \* [OH_MD_KEY_MATRIX_COEFFICIENTS](#oh_md_key_matrix_coefficients) | Pointer to the key that describes the video matrix coefficients. The value type is int32_t. For details, see [OH_MatrixCoefficient](#oh_matrixcoefficient). The value complies with Table 4 in H.273.| 316| const char \* [OH_MD_KEY_SCALING_MODE](#oh_md_key_scaling_mode) | Pointer to the key that describes the video scaling mode. The value type is int32_t. For details, see [OH_ScalingMode](#oh_scalingmode). This key is optional and is used only for video decoding in surface mode. You are advised to set the scaling mode by calling [OH_NativeWindow_NativeWindowSetScalingModeV2](../apis-arkgraphics2d/capi-external-window-h.md#oh_nativewindow_nativewindowsetscalingmodev2). (It is deprecated from API version 14.)| 317| const char \* [OH_MD_KEY_VIDEO_CROP_TOP](#oh_md_key_video_crop_top) | Pointer to the key that describes the top coordinate (y) of the cropped rectangle. The value type is int32_t. | 318| const char \* [OH_MD_KEY_VIDEO_CROP_BOTTOM](#oh_md_key_video_crop_bottom) | Pointer to the key that describes the bottom coordinate (y) of the cropped rectangle. The value type is int32_t. | 319| const char \* [OH_MD_KEY_VIDEO_CROP_LEFT](#oh_md_key_video_crop_left) | Pointer to the key that describes the left coordinate (x) of the cropped rectangle. The value type is int32_t. | 320| const char \* [OH_MD_KEY_VIDEO_CROP_RIGHT](#oh_md_key_video_crop_right) | Pointer to the key that describes the right coordinate (x) of the cropped rectangle. The value type is int32_t.| 321| const char \* [OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR](#oh_md_key_video_decoder_output_enable_vrr) | Pointer to the key that specifies whether the decoder enables the video variable frame rate feature. The value type is int32_t.| 322| const char \* [OH_MD_KEY_SQR_FACTOR](#oh_md_key_sqr_factor) | Pointer to the key that describes the quality parameter in SQR mode. The value range is [0, 51] (same as the QP value in encoding). A smaller value indicates a higher output bit rate and better quality. The value type is int32_t.| 323| const char \* [OH_MD_KEY_MAX_BITRATE](#oh_md_key_max_bitrate) | Pointer to the key that describes the maximum bit rate in SQR mode. The value range can be obtained by calling [OH_AVCapability_GetEncoderBitrateRange](_a_v_capability.md#oh_avcapability_getencoderbitraterange) and is the same as that of [OH_MD_KEY_BITRATE](#oh_md_key_bitrate). The unit is bit/s. The value type is int64_t.| 324| const char \* [OH_MD_KEY_VIDEO_ENCODER_ROI_PARAMS](#oh_md_key_video_encoder_roi_params) | Pointer to the key that describes the ROI encoding parameters, including the ROI area and deltaQp. The value type is string.| 325| const char \* [OH_MD_KEY_VIDEO_STRIDE](#oh_md_key_video_stride) | Pointer to the key that describes the stride of the video frame. The value type is int32_t. | 326| const char \* [OH_MD_KEY_VIDEO_SLICE_HEIGHT](#oh_md_key_video_slice_height) | Pointer to the key that describes the height of the video frame. The value type is int32_t. | 327| const char \* [OH_MD_KEY_VIDEO_PIC_WIDTH](#oh_md_key_video_pic_width) | Pointer to the key that describes the width of the video frame. The value type is int32_t. | 328| const char \* [OH_MD_KEY_VIDEO_PIC_HEIGHT](#oh_md_key_video_pic_height) | Pointer to the key that describes the height of the video frame. The value type is int32_t. | 329| const char \* [OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY](#oh_md_key_video_enable_low_latency) | Pointer to the key that describes the enabled status of low-latency video decoding. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. If enabled, the input and output data held by the video decoder does not exceed the amount required by the codec standard. | 330| const char \* [OH_MD_KEY_ENABLE_SYNC_MODE](#oh_md_key_enable_sync_mode) | Pointer to the key that describes the enabled status of audio/video codec synchronization. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and used only in the configuration phase.| 331| const char \* [OH_MD_KEY_VIDEO_ENCODER_ENABLE_PTS_BASED_RATECONTROL](#oh_md_key_video_encoder_enable_pts_based_ratecontrol) | Pointer to the key that describes the enabled status of the PTS-based bit rate control mode. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. If this feature is enabled, each video frame must contain PTS information and be sent to the encoder.| 332| const char \* [OH_MD_KEY_VIDEO_ENCODER_ENABLE_B_FRAME](#oh_md_key_video_encoder_enable_b_frame) | Pointer to the key that describes the enabled status of B-frame encoding. The value type is int32_t. **1** if enabled, **0** otherwise. This key is optional and used only in the configuration phase of video encoding. The default value is **0**.| 333| const char \* [OH_MD_KEY_VIDEO_ENCODER_MAX_B_FRAMES](#oh_md_key_video_encoder_max_b_frames) | Pointer to the key that describes the maximum number of B-frames supported by B-frame encoding in video encoding. The value type is int32_t.| 334| const char \* [OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE](#oh_md_key_video_encode_bitrate_mode) | Pointer to the key that describes the video encoding bit rate mode. The value type is int32_t. For details, see [OH_BitrateMode](#oh_bitratemode-1).| 335| const char \* [OH_MD_KEY_QUALITY](#oh_md_key_quality) | Pointer to the key that describes the required encoding quality. The value type is int32_t. This key applies only to encoders configured in constant quality mode.| 336| const char \* [OH_MD_KEY_REQUEST_I_FRAME](#oh_md_key_request_i_frame) | Pointer to the key that describes the request for immediate encoding of I-frames. The value type is int32_t.| 337| const char \* [OH_MD_KEY_I_FRAME_INTERVAL](#oh_md_key_i_frame_interval) | Pointer to the key that describes the key frame interval, in milliseconds. The value type is int32_t. This key is optional and is used only for video encoding.| 338| const char \* [OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY](#oh_md_key_video_encoder_enable_temporal_scalability) | Pointer to the key that describes the enabled status of temporal scalability. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. | 339| const char \* [OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE](#oh_md_key_video_encoder_temporal_gop_size) | Pointer to the key that describes the size of a temporal image group. The value type is int32_t. This key is valid only when temporal scalability is enabled. | 340| const char \* [OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE](#oh_md_key_video_encoder_temporal_gop_reference_mode) | Pointer to the key that describes the reference mode in a temporal image group. The value type is int32_t. For details, see [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode). This key is valid only when temporal scalability is enabled. | 341| const char \* [OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT](#oh_md_key_video_encoder_ltr_frame_count) | Pointer to the key that describes the number of LTR frames. The value type is int32_t. The value must be within the supported value range. This key is optional and is used only for video encoding. | 342| const char \* [OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR](#oh_md_key_video_encoder_per_frame_mark_ltr) | Pointer to the key that specifies whether the current frame is marked as an LTR frame. The value type is int32_t. **1** if marked, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and is used only for video encoding. | 343| const char \* [OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR](#oh_md_key_video_encoder_per_frame_use_ltr) | Pointer to the key that describes the POC number of the LTR frame referenced by the current frame. The value type is int32_t. This key is optional and is used only for video encoding. | 344| const char \* [OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR](#oh_md_key_video_per_frame_is_ltr) | Pointer to the key that specifies whether the frame corresponding to the stream output from the current OH_AVBuffer is marked as an LTR frame. The value type is int32_t. **1** if marked, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and is used only for video encoding. | 345| const char \* [OH_MD_KEY_VIDEO_PER_FRAME_POC](#oh_md_key_video_per_frame_poc) | Pointer to the key that describes the POC number of the frame. The value type is int32_t. This key is optional and is used only for video encoding. | 346| const char \* [OH_MD_KEY_VIDEO_ENCODER_QP_MAX](#oh_md_key_video_encoder_qp_max) | Pointer to the key that describes the maximum QP allowed by the video encoder. The value type is int32_t. | 347| const char \* [OH_MD_KEY_VIDEO_ENCODER_QP_MIN](#oh_md_key_video_encoder_qp_min) | Pointer to the key that describes the minimum QP allowed by the video encoder. The value type is int32_t. | 348| const char \* [OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE](#oh_md_key_video_encoder_qp_average) | Pointer to the key that describes the average QP of video frames. The value type is int32_t.| 349| const char \* [OH_MD_KEY_VIDEO_ENCODER_MSE](#oh_md_key_video_encoder_mse) |Pointer to the key that describes the MSE of video frames. The value type is double. | 350| const char \* [OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER](#oh_md_key_video_encoder_repeat_previous_frame_after) | Pointer to the key that describes the duration (in milliseconds) for which the last frame will be resubmitted repeatedly, if no new frame is available after the previous frame is submitted to the encoder. The value type is int32_t.| 351| const char \* [OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT](#oh_md_key_video_encoder_repeat_previous_max_count) | Pointer to the key that describes the maximum number of times the encoder can repeat encoding the previous frame when no new frame is available. The value type is int32_t.| 352| const char \* [OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE](#oh_md_key_video_decoder_output_color_space) | Pointer to the key that describes the output color space of the video decoder. The value type is int32_t. The supported value is **OH_COLORSPACE_BT709_LIMIT**.| 353| const char \* [OH_MD_KEY_VIDEO_DECODER_BLANK_FRAME_ON_SHUTDOWN](#oh_md_key_video_decoder_blank_frame_on_shutdown) | Pointer to the key that specifies whether to output blank frames when the video decoder is disabled. The value type is int32_t. **1** to output, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and is used only for video decoding in surface mode.| 354| const char \* [OH_MD_KEY_AUDIO_SAMPLE_FORMAT](#oh_md_key_audio_sample_format) | Pointer to the key that describes the original audio format. The value type is int32_t. For details, see [OH_BitsPerSample](#oh_bitspersample-1).| 355| const char \* [OH_MD_KEY_AUD_CHANNEL_COUNT](#oh_md_key_aud_channel_count) | Pointer to the key that describes the number of audio channels. The value type is int32_t.| 356| const char \* [OH_MD_KEY_AUD_SAMPLE_RATE](#oh_md_key_aud_sample_rate) | Pointer to the key that describes the audio sampling rate. The value type is int32_t.| 357| const char \* [OH_MD_KEY_AUDIO_COMPRESSION_LEVEL](#oh_md_key_audio_compression_level) | Pointer to the key that describes the audio codec compression level. The value type is int32_t type. This key is used only for audio encoding.| 358| const char \* [OH_MD_KEY_CHANNEL_LAYOUT](#oh_md_key_channel_layout) | Pointer to the key that describes the required encoding channel layout. The value type is int64_t. This key applies only to encoders.| 359| const char \* [OH_MD_KEY_BITS_PER_CODED_SAMPLE](#oh_md_key_bits_per_coded_sample) | Pointer to the key that describes the number of bits per sample. The value type is int32_t.<br>In versions earlier than API version 20, this parameter must be set to **1** for FLAC encoding. Otherwise, **OH_AudioCodec_Configure** returns the error code **AV_ERR_INVALID_VAL**. However, this parameter has no actual effect and does not affect the encoding result. Starting from API version 20, you do not need to set it anymore.| 360| const char \* [OH_MD_KEY_SBR](#oh_md_key_sbr) | Pointer to the key that describes the AAC SBR format. The value type is int32_t. This key applies to AAC encoders.| 361| const char \* [OH_MD_KEY_COMPLIANCE_LEVEL](#oh_md_key_compliance_level) | Pointer to the key that describes the FLAC compliance level. The value type is int32_t. This key is used only for audio encoding.| 362| const char \* [OH_MD_KEY_AAC_IS_ADTS](#oh_md_key_aac_is_adts) | Pointer to the key that describes the AAC format, which can be ADTS or LATM. The value type is int32_t. This key applies to AAC decoders.| 363| const char \* [OH_MD_KEY_IDENTIFICATION_HEADER](#oh_md_key_identification_header) | Pointer to the key that describes the Vorbis identification header. The value type is uint8_t. This key applies only to Vorbis decoders.| 364| const char \* [OH_MD_KEY_SETUP_HEADER](#oh_md_key_setup_header) | Pointer to the key that describes the Vorbis setup header. The value type is uint8_t. This key applies only to Vorbis decoders.| 365| const char \* [OH_MD_KEY_AUDIO_OBJECT_NUMBER](#oh_md_key_audio_object_number) | Pointer to the key that describes the number of audio objects. The value type is int32_t. This key is used only for Audio Vivid decoding.| 366| const char \* [OH_MD_KEY_AUDIO_VIVID_METADATA](#oh_md_key_audio_vivid_metadata) | Pointer to the key that describes the Audio Vivid metadata. The value type is uint8_t\*. This key is used only for Audio Vivid decoding.| 367| const char \* [OH_MD_KEY_VIDEO_IS_HDR_VIVID](#oh_md_key_video_is_hdr_vivid) | Pointer to the key that specifies whether the video track in a media file is HDR Vivid. The value type is int32_t. This key is used for both multiplexing and demultiplexing.| 368| const char \* [OH_MD_KEY_START_TIME](#oh_md_key_start_time) | Pointer to the key that describes the start time of the first frame in a media file, measured in microseconds. The value type is int64_t. | 369| const char \* [OH_MD_KEY_TRACK_START_TIME](#oh_md_key_track_start_time) | Pointer to the key that describes the start time of the track, measured in microseconds. The value type is int64_t. | 370| const char \* [OH_MD_KEY_TRACK_TYPE](#oh_md_key_track_type) | Pointer to the key that describes the track type in a media file. The value type is int32_t. For details, see [OH_MediaType](#oh_mediatype-1).| 371| const char \* [OH_MD_KEY_DURATION](#oh_md_key_duration) | Pointer to the key that describes the duration in a media file. The value type is int64_t.| 372| const char \* [OH_MD_KEY_TITLE](#oh_md_key_title) | Pointer to the key that describes the title in a media file. The value type is string.| 373| const char \* [OH_MD_KEY_ARTIST](#oh_md_key_artist) | Pointer to the key that describes the lyrics in a media file. The value type is string.| 374| const char \* [OH_MD_KEY_ALBUM](#oh_md_key_album) | Pointer to the key that describes the album in a media file. The value type is string.| 375| const char \* [OH_MD_KEY_ALBUM_ARTIST](#oh_md_key_album_artist) | Pointer to the key that describes the album artist of the input media. The value type is string.| 376| const char \* [OH_MD_KEY_DATE](#oh_md_key_date) | Pointer to the key that describes the date in a media file, for example, 2024. The value type is string.| 377| const char \* [OH_MD_KEY_COMMENT](#oh_md_key_comment) | Pointer to the key that describes the comment in a media file. The value type is string.| 378| const char \* [OH_MD_KEY_GENRE](#oh_md_key_genre) | Pointer to the key that describes the genre in a media file. The value type is string.| 379| const char \* [OH_MD_KEY_COPYRIGHT](#oh_md_key_copyright) | Pointer to the key that describes the copyright in a media file. The value type is string.| 380| const char \* [OH_MD_KEY_LANGUAGE](#oh_md_key_language) | Pointer to the key that describes the language in a media file. The value type is string.| 381| const char \* [OH_MD_KEY_DESCRIPTION](#oh_md_key_description) | Pointer to the key that describes the description in a media file. The value type is string.| 382| const char \* [OH_MD_KEY_LYRICS](#oh_md_key_lyrics) | Pointer to the key that describes the lyrics in a media file. The value type is string.| 383| const char \* [OH_MD_KEY_TRACK_COUNT](#oh_md_key_track_count) | Pointer to the key that describes the number of tracks in a media file. The value type is int32_t.| 384| const char \* [OH_MD_KEY_BUFFER_DURATION](#oh_md_key_buffer_duration) | Pointer to the key that describes the duration corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t. | 385| const char \* [OH_MD_KEY_DECODING_TIMESTAMP](#oh_md_key_decoding_timestamp) | Pointer to the key that describes the decoding timestamp corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t. | 386| const char \* [OH_MD_KEY_CODEC_MIME](#oh_md_key_codec_mime) | Pointer to the key that describes the [MIME](#media-codec-formats) type of the codec. The value type is string.| 387| const char \* [OH_MD_KEY_VIDEO_SAR](#oh_md_key_video_sar) | Pointer to the key that describes the aspect ratio of the sample. The value type is double.| 388| const char \* [OH_MD_KEY_CREATION_TIME](#oh_md_key_creation_time) | Pointer to the key that describes the media file creation time. The value type is string.| 389| const char \* [OH_MD_KEY_REFERENCE_TRACK_IDS](#oh_md_key_reference_track_ids) | Pointer to the key that describes the reference relationship between media file tracks. The value type is int32_t\*.| 390| const char \* [OH_MD_KEY_TRACK_REFERENCE_TYPE](#oh_md_key_track_reference_type) | Pointer to the key that describes the auxiliary track type of a media file. The value type is string.| 391| const char \* [OH_MD_KEY_TRACK_DESCRIPTION](#oh_md_key_track_description) | Pointer to the key that describes the auxiliary track description of a media file. The value type is string.| 392| const char \* [OH_MD_KEY_ENABLE_MOOV_FRONT](#oh_md_key_enable_moov_front) | Pointer to the key that specifies whether the moov metadata should be at the front of a media file. The value type is int32_t.| 393 394 395## Type Description 396 397 398### OH_AACProfile 399 400``` 401typedef enum OH_AACProfile OH_AACProfile 402``` 403 404**Description** 405 406Defines an enum for the AAC profiles. 407 408**System capability**: SystemCapability.Multimedia.Media.CodecBase 409 410**Since**: 9 411 412 413### OH_AVCLevel 414 415``` 416typedef enum OH_AVCLevel OH_AVCLevel 417``` 418**Description** 419 420Defines an enum for the AVC levels. 421 422**System capability**: SystemCapability.Multimedia.Media.CodecBase 423 424**Since**: 12 425 426 427### OH_AVCodec 428 429``` 430typedef struct OH_AVCodec OH_AVCodec 431``` 432**Description** 433 434Defines a struct for a native object for the audio and video codec interface. 435 436**Since**: 9 437 438 439### OH_AVCodecAsyncCallback 440 441``` 442typedef struct OH_AVCodecAsyncCallback OH_AVCodecAsyncCallback 443``` 444 445**Description** 446 447Defines a struct for all the asynchronous callback function pointers of an OH_AVCodec instance. To ensure the normal running of OH_AVCodec, you must register the instance of this struct with the OH_AVCodec instance and process the information reported by the callback function. 448 449**System capability**: SystemCapability.Multimedia.Media.CodecBase 450 451**Since**: 9 452 453**Deprecated from**: 11 454 455**Substitute**: [OH_AVCodecCallback](#oh_avcodeccallback) 456 457**Parameters** 458 459| Name| Description| 460| -------- | -------- | 461| onError | Callback used to report a codec operation error. For details, see [OH_AVCodecOnError](#oh_avcodeconerror).| 462| onStreamChanged | Callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).| 463| onNeedInputData | Callback used to report input data required. For details, see [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata).| 464| onNeedOutputData | Callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata).| 465 466 467### OH_AVCodecCallback 468 469``` 470typedef struct OH_AVCodecCallback OH_AVCodecCallback 471``` 472 473**Description** 474 475Defines a struct for all the asynchronous callback function pointers of an OH_AVCodec instance. To ensure the normal running of OH_AVCodec, you must register the instance of this struct with the OH_AVCodec instance and process the information reported by the callback function. 476 477**System capability**: SystemCapability.Multimedia.Media.CodecBase 478 479**Since**: 11 480 481**Parameters** 482 483| Name| Description| 484| -------- | -------- | 485| onError | Callback used to report a codec operation error. For details, see [OH_AVCodecOnError](#oh_avcodeconerror).| 486| onStreamChanged | Callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).| 487| onNeedInputBuffer | Callback used to report input data required. For details, see [OH_AVCodecOnNeedInputBuffer](#oh_avcodeconneedinputbuffer).| 488| onNewOutputBuffer | Callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputBuffer](#oh_avcodeconnewoutputbuffer).| 489 490 491### OH_AVCodecOnError 492 493``` 494typedef void(* OH_AVCodecOnError) (OH_AVCodec *codec, int32_t errorCode, void *userData) 495``` 496 497**Description** 498 499Defines the pointer to the function that is called to report error information when an error occurs during the running of an OH_AVCodec instance. 500 501| Use Case| Error Code| 502| -------- | -------- | 503| Audio encoding/decoding| **AV_ERR_DRM_DECRYPT_FAILED**: DRM decryption failed. | 504| Video encoding/decoding| **AV_ERROR_NO_MEMORY**: System resources are insufficient.<br>**AV_ERROR_UNKNOWN**: An unknown error occurs. Analyze the error based on specific logs.<br>**AV_ERR_SERVICE_DIED**: The service is dead. | 505| Video decoding| **AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION**: The current input does not support CSC. | 506<!--RP1--><!--RP1End--> 507 508**System capability**: SystemCapability.Multimedia.Media.CodecBase 509 510**Since**: 9 511 512**Parameters** 513 514| Name| Description| 515| -------- | -------- | 516| codec | Pointer to an OH_AVCodec instance. | 517| errorCode | Error code. The returned error codes vary in scenarios. For details, see the table in the function description. | 518| userData | Pointer to the data on which the caller depends when executing the callback. | 519 520 521### OH_AVCodecOnNeedInputBuffer 522 523``` 524typedef void(* OH_AVCodecOnNeedInputBuffer) (OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData) 525``` 526 527**Description** 528 529Defines the pointer to the function that is called when new input data is required during the running of an OH_AVCodec instance. The function carries a buffer to fill in new input data. 530 531**System capability**: SystemCapability.Multimedia.Media.CodecBase 532 533**Since**: 11 534 535**Parameters** 536 537| Name| Description| 538| -------- | -------- | 539| codec | Pointer to an OH_AVCodec instance. | 540| index | Index of the new input buffer. | 541| buffer | Pointer to the data to fill in the new input buffer. | 542| userData | Pointer to the data on which the caller depends when executing the callback. | 543 544 545### OH_AVCodecOnNeedInputData 546 547``` 548typedef void(* OH_AVCodecOnNeedInputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData) 549``` 550 551**Description** 552 553Defines the pointer to the function that is called when new input data is required during the running of an OH_AVCodec instance. The function carries a buffer to fill in new input data. 554 555**System capability**: SystemCapability.Multimedia.Media.CodecBase 556 557**Since**: 9 558 559**Deprecated from**: 11 560 561**Substitute**: [OH_AVCodecOnNeedInputBuffer](#oh_avcodeconneedinputbuffer) 562 563**Parameters** 564 565| Name| Description| 566| -------- | -------- | 567| codec | Pointer to an OH_AVCodec instance. | 568| index | Index of the new input buffer. | 569| data | Pointer to the data to fill in the new input buffer. | 570| userData | Pointer to the data on which the caller depends when executing the callback. | 571 572 573### OH_AVCodecOnNewOutputBuffer 574 575``` 576typedef void(* OH_AVCodecOnNewOutputBuffer) (OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData) 577``` 578 579**Description** 580 581Defines the pointer to the function that is called when new output data is generated during the running of an OH_AVCodec instance. The function carries a buffer filled with new output data. 582 583**System capability**: SystemCapability.Multimedia.Media.CodecBase 584 585**Since**: 11 586 587**Parameters** 588 589| Name| Description| 590| -------- | -------- | 591| codec | Pointer to an OH_AVCodec instance. | 592| index | Index of the new output buffer. | 593| buffer | Pointer to the data filled in the new output buffer. | 594| userData | Pointer to the data on which the caller depends when executing the callback. | 595 596 597### OH_AVCodecOnNewOutputData 598 599``` 600typedef void(* OH_AVCodecOnNewOutputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, OH_AVCodecBufferAttr *attr, void *userData) 601``` 602 603**Description** 604 605Defines the pointer to the function that is called when new output data is generated during the running of an OH_AVCodec instance. The function carries a buffer filled with new output data. Note that the lifecycle of the pointer to the OH_AVCodecBufferAttr instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called. 606 607**System capability**: SystemCapability.Multimedia.Media.CodecBase 608 609**Since**: 9 610 611**Deprecated from**: 11 612 613**Substitute**: [OH_AVCodecOnNewOutputBuffer](#oh_avcodeconnewoutputbuffer) 614 615**Parameters** 616 617| Name| Description| 618| -------- | -------- | 619| codec | Pointer to an OH_AVCodec instance. | 620| index | Index of the new output buffer. | 621| data | Pointer to the data filled in the new output buffer. | 622| attr | Pointer to the description information about the new output buffer. For details, see [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md). | 623| userData | Pointer to the data on which the caller depends when executing the callback. | 624 625 626### OH_AVCodecOnStreamChanged 627 628``` 629typedef void(* OH_AVCodecOnStreamChanged) (OH_AVCodec *codec, OH_AVFormat *format, void *userData) 630``` 631 632**Description** 633 634Defines the pointer to the function that is called to report the new stream description when the resolution of the input video stream being decoded or the output video stream that has been encoded changes.<br>From API version 15, this function pointer is called to report the new stream description when the stream sampling rate, number of audio channels, or audio sampling format changes during audio decoding. The decoding formats that can detect these changes include <!--RP3--><!--RP3End-->AAC, FLAC, MP3, and VORBIS.<br>Note that the lifecycle of the pointer to the OH_AVFormat instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called. 635 636**System capability**: SystemCapability.Multimedia.Media.CodecBase 637 638**Since**: 9 639 640**Parameters** 641 642| Name| Description| 643| -------- | -------- | 644| codec | Pointer to an OH_AVCodec instance. | 645| format | Pointer to the description information about the new output stream. | 646| userData | Pointer to the data on which the caller depends when executing the callback. | 647 648 649### OH_AVCProfile 650 651``` 652typedef enum OH_AVCProfile OH_AVCProfile 653``` 654 655**Description** 656 657Defines an enum for the AVC profiles. 658 659**System capability**: SystemCapability.Multimedia.Media.CodecBase 660 661**Since**: 9 662 663 664### OH_AVDataSource 665 666``` 667typedef struct OH_AVDataSource OH_AVDataSource 668``` 669 670**Description** 671 672Defines a struct for a user-defined data source. 673 674**System capability**: SystemCapability.Multimedia.Media.CodecBase 675 676**Since**: 12 677 678 679### OH_AVDataSourceReadAt 680 681``` 682typedef int32_t(* OH_AVDataSourceReadAt) (OH_AVBuffer *data, int32_t length, int64_t pos) 683``` 684 685**Description** 686 687Defines a function pointer used to provide the capability of obtaining user-defined media data. 688 689**System capability**: SystemCapability.Multimedia.Media.CodecBase 690 691**Since**: 12 692 693**Parameters** 694 695| Name| Description| 696| -------- | -------- | 697| data | Pointer to the buffer to be filled in. | 698| length | Length of the data to read. | 699| pos | Offset from which the data is read. | 700 701**Returns** 702 703Actual length of the data read to the buffer. 704 705 706### OH_AVDataSourceExt 707 708``` 709typedef struct OH_AVDataSourceExt OH_AVDataSourceExt 710``` 711 712**Description** 713 714Defines a struct for a user-defined data source. 715 716**System capability**: SystemCapability.Multimedia.Media.CodecBase 717 718**Since**: 20 719 720 721### OH_AVDataSourceReadAtExt 722 723``` 724typedef int32_t (*OH_AVDataSourceReadAtExt)(OH_AVBuffer *data, int32_t length, int64_t pos, void *userData) 725``` 726 727**Description** 728 729Defines a function pointer used to provide the capability of obtaining user-defined media data. 730 731**System capability**: SystemCapability.Multimedia.Media.CodecBase 732 733**Since**: 20 734 735**Parameters** 736 737| Name| Description| 738| -------- | -------- | 739| data | Pointer to the buffer to be filled in. | 740| length | Length of the data to read. | 741| pos | Offset from which the data is read. | 742| userData | Pointer to user-defined data. | 743 744**Returns** 745 746Actual length of the data read to the buffer. 747 748 749### OH_AVOutputFormat 750 751``` 752typedef enum OH_AVOutputFormat OH_AVOutputFormat 753``` 754 755**Description** 756 757Defines an enum for the output file formats supported by a muxer. 758 759**System capability**: SystemCapability.Multimedia.Media.CodecBase 760 761**Since**: 10 762 763 764### OH_AVSeekMode 765 766``` 767typedef enum OH_AVSeekMode OH_AVSeekMode 768``` 769 770**Description** 771 772Defines an enum for the seek modes. 773 774**System capability**: SystemCapability.Multimedia.Media.CodecBase 775 776**Since**: 10 777 778 779### OH_BitsPerSample 780 781``` 782typedef enum OH_BitsPerSample OH_BitsPerSample 783``` 784 785**Description** 786 787Defines an enum for the number of audio bits for each coded sample. 788 789**System capability**: SystemCapability.Multimedia.Media.CodecBase 790 791**Since**: 10 792 793 794### OH_ColorPrimary 795 796``` 797typedef enum OH_ColorPrimary OH_ColorPrimary 798``` 799 800**Description** 801 802Defines an enum for the primary colors. 803 804**System capability**: SystemCapability.Multimedia.Media.CodecBase 805 806**Since**: 10 807 808 809### OH_HEVCLevel 810 811``` 812typedef enum OH_HEVCLevel OH_HEVCLevel 813``` 814 815**Description** 816 817Defines an enum for the HEVC levels. 818 819**System capability**: SystemCapability.Multimedia.Media.CodecBase 820 821**Since**: 12 822 823 824### OH_HEVCProfile 825 826``` 827typedef enum OH_HEVCProfile OH_HEVCProfile 828``` 829 830**Description** 831 832Defines an enum for the HEVC profiles. 833 834**System capability**: SystemCapability.Multimedia.Media.CodecBase 835 836**Since**: 10 837 838 839### OH_MatrixCoefficient 840 841``` 842typedef enum OH_MatrixCoefficient OH_MatrixCoefficient 843``` 844 845**Description** 846 847Defines an enum for the matrix coefficients. 848 849**System capability**: SystemCapability.Multimedia.Media.CodecBase 850 851**Since**: 10 852 853 854### OH_MediaType 855 856``` 857typedef enum OH_MediaType OH_MediaType 858``` 859 860**Description** 861 862Defines an enum for the media types. 863 864**System capability**: SystemCapability.Multimedia.Media.CodecBase 865 866**Since**: 9 867 868 869### OH_MPEG2Level 870 871``` 872typedef enum OH_MPEG2Level OH_MPEG2Level 873``` 874 875**Description** 876 877Defines an enum for the MPEG2 levels. 878 879**System capability**: SystemCapability.Multimedia.Media.CodecBase 880 881**Since**: 17 882 883 884### OH_MPEG2Profile 885 886``` 887typedef enum OH_MPEG2Profile OH_MPEG2Profile 888``` 889 890**Description** 891 892Defines an enum for the MPEG2 profiles. 893 894**System capability**: SystemCapability.Multimedia.Media.CodecBase 895 896**Since**: 17 897 898 899### OH_MPEG4Level 900 901``` 902typedef enum OH_MPEG4Level OH_MPEG4Level 903``` 904 905**Description** 906 907Defines an enum for the MPEG4 levels. 908 909**System capability**: SystemCapability.Multimedia.Media.CodecBase 910 911**Since**: 17 912 913 914### OH_MPEG4Profile 915 916``` 917typedef enum OH_MPEG4Profile OH_MPEG4Profile 918``` 919 920**Description** 921 922Defines an enum for the MPEG4 profiles. 923 924**System capability**: SystemCapability.Multimedia.Media.CodecBase 925 926**Since**: 17 927 928 929### OH_ScalingMode 930 931``` 932typedef enum OH_ScalingMode OH_ScalingMode 933``` 934 935**Description** 936 937Defines an enum for the scaling modes. This enum is used only in surface mode. 938 939**System capability**: SystemCapability.Multimedia.Media.CodecBase 940 941**Since**: 10 942 943**Deprecated from**: 14 944 945**Substitute**: [OHScalingModeV2](../apis-arkgraphics2d/capi-external-window-h.md#ohscalingmodev2) 946 947 948### OH_TemporalGopReferenceMode 949 950``` 951typedef enum OH_TemporalGopReferenceMode OH_TemporalGopReferenceMode 952``` 953 954**Description** 955 956Defines an enum for the reference modes of temporal image groups. 957 958**System capability**: SystemCapability.Multimedia.Media.CodecBase 959 960**Since**: 12 961 962### OH_VVCLevel 963 964``` 965typedef enum OH_VVCLevel OH_VVCLevel 966``` 967 968**Description** 969 970Defines an enum for the VVC levels. 971 972**System capability**: SystemCapability.Multimedia.Media.CodecBase 973 974**Since**: 15 975 976 977### OH_VVCProfile 978 979``` 980typedef enum OH_VVCProfile OH_VVCProfile 981``` 982 983**Description** 984 985Defines an enum for the VVC profiles. 986 987**System capability**: SystemCapability.Multimedia.Media.CodecBase 988 989**Since**: 15 990 991 992### OH_H263Level 993 994``` 995typedef enum OH_H263Level OH_H263Level 996``` 997 998**Description** 999 1000Defines an enum for the H.263 levels. 1001 1002**System capability**: SystemCapability.Multimedia.Media.CodecBase 1003 1004**Since**: 17 1005 1006 1007### OH_H263Profile 1008 1009``` 1010typedef enum OH_H263Profile OH_H263Profile 1011``` 1012 1013**Description** 1014 1015Defines an enum for the H.263 profiles. 1016 1017**System capability**: SystemCapability.Multimedia.Media.CodecBase 1018 1019**Since**: 17 1020 1021 1022### OH_TransferCharacteristic 1023 1024``` 1025typedef enum OH_TransferCharacteristic OH_TransferCharacteristic 1026``` 1027 1028**Description** 1029 1030Defines an enum for the transfer characteristics. 1031 1032**System capability**: SystemCapability.Multimedia.Media.CodecBase 1033 1034**Since**: 10 1035 1036 1037### OH_BitrateMode 1038 1039``` 1040typedef enum OH_BitrateMode OH_BitrateMode 1041``` 1042 1043**Description** 1044 1045Defines an enum for the bit rate modes of an encoder. The key position is changed from API version 14. 1046 1047**System capability**: SystemCapability.Multimedia.Media.CodecBase 1048 1049**Since**: 10 1050 1051 1052### OHNativeWindow 1053 1054``` 1055typedef struct NativeWindow OHNativeWindow 1056``` 1057**Description** 1058 1059Defines a struct for a native object for the graphics interface. 1060 1061**Since**: 9 1062 1063 1064## Enum Description 1065 1066 1067### AudioChannelLayout 1068 1069``` 1070enum AudioChannelLayout : uint64_t 1071``` 1072 1073**Description** 1074 1075Enumerates the layouts of audio channels. The output format of the decoder is described using the channel layout of the codec. 1076 1077**System capability**: SystemCapability.Multimedia.Media.CodecBase 1078 1079**Since**: 10 1080 1081**Deprecated from**: 11 1082 1083**Substitute**: [OH_AudioChannelLayout](_core.md#oh_audiochannellayout) 1084 1085| Value| Description| 1086| -------- | -------- | 1087| UNKNOWN_CHANNEL_LAYOUT | Unknown.| 1088| MONO | Mono layout.| 1089| STEREO | Stereo layout.| 1090| CH_2POINT1 | 2.1 layout.| 1091| CH_2_1 | 2_1 layout.| 1092| SURROUND | Surround layout.| 1093| CH_3POINT1 | 3.1 layout.| 1094| CH_4POINT0 | 4.0 layout.| 1095| CH_4POINT1 | 4.1 layout.| 1096| CH_2_2 | 2_2 layout.| 1097| QUAD | Quad layout.| 1098| CH_5POINT0 | 5.0 layout.| 1099| CH_5POINT1 | 5.1 layout.| 1100| CH_5POINT0_BACK | 5.0 rear layout.| 1101| CH_5POINT1_BACK | 5.1 rear layout.| 1102| CH_6POINT0 | 6.0 layout.| 1103| CH_6POINT0_FRONT | 6.0 front layout.| 1104| HEXAGONAL | Hexagonal layout.| 1105| CH_6POINT1 | 6.1 layout.| 1106| CH_6POINT1_BACK | 6.1 rear layout.| 1107| CH_6POINT1_FRONT | 6.1 front layout.| 1108| CH_7POINT0 | 7.0 layout.| 1109| CH_7POINT0_FRONT | 7.0 front layout.| 1110| CH_7POINT1 | 7.1 layout.| 1111| CH_7POINT1_WIDE | 7.1 wide layout.| 1112| CH_7POINT1_WIDE_BACK | 7.1 rear wide layout.| 1113| CH_3POINT1POINT2 | 3.1.2 layout.| 1114| CH_5POINT1POINT2 | 5.1.2 layout.| 1115| CH_5POINT1POINT4 | 5.1.4 layout.| 1116| CH_7POINT1POINT2 | 7.1.2 layout.| 1117| CH_7POINT1POINT4 | 7.1.4 layout.| 1118| CH_9POINT1POINT4 | 9.1.4 layout.| 1119| CH_9POINT1POINT6 | 9.1.6 layout.| 1120| CH_10POINT2 | 10.2 layout.| 1121| CH_22POINT2 | 22.2 layout.| 1122| OCTAGONAL | Octagonal layout.| 1123| HEXADECAGONAL | Hexadecagonal layout.| 1124| STEREO_DOWNMIX | Stereo downmix layout.| 1125| HOA_FIRST | High-Order Ambisonics (HOA) first-order layout.| 1126| HOA_SECOND | HOA second-order layout.| 1127| HOA_THIRD | HOA third-order layout.| 1128 1129 1130### AudioChannelSet 1131 1132``` 1133enum AudioChannelSet : uint64_t 1134``` 1135 1136**Description** 1137 1138Enumerates the audio channels. Each channel is mapped to a variable of int64_t. 1139 1140**System capability**: SystemCapability.Multimedia.Media.CodecBase 1141 1142**Since**: 10 1143 1144**Deprecated from**: 11 1145 1146**Substitute**: [OH_AudioChannelSet](_core.md#oh_audiochannelset) 1147 1148| Value| Description| 1149| -------- | -------- | 1150| FRONT_LEFT | Front left channel.| 1151| FRONT_RIGHT | Front right channel.| 1152| FRONT_CENTER | Front center channel.| 1153| LOW_FREQUENCY | Low-frequency channel.| 1154| BACK_LEFT | Rear left channel.| 1155| BACK_RIGHT | Rear right channel.| 1156| FRONT_LEFT_OF_CENTER | Front left center channel.| 1157| FRONT_RIGHT_OF_CENTER | Front right center channel.| 1158| BACK_CENTER | Rear center channel.| 1159| SIDE_LEFT | Left channel.| 1160| SIDE_RIGHT | Right channel.| 1161| TOP_CENTER | Top center channel.| 1162| TOP_FRONT_LEFT | Top left front channel.| 1163| TOP_FRONT_CENTER | Top center front channel.| 1164| TOP_FRONT_RIGHT | Top right front channel.| 1165| TOP_BACK_LEFT | Top left rear channel.| 1166| TOP_BACK_CENTER | Top center rear channel.| 1167| TOP_BACK_RIGHT | Top right rear channel.| 1168| STEREO_LEFT | Stereo left channel.| 1169| STEREO_RIGHT | Stereo right channel.| 1170| WIDE_LEFT | Wide left channel.| 1171| WIDE_RIGHT | Wide right channel.| 1172| SURROUND_DIRECT_LEFT | Left surround channel.| 1173| SURROUND_DIRECT_RIGHT | Right surround channel.| 1174| LOW_FREQUENCY_2 | Low-frequency channel 2.| 1175| TOP_SIDE_LEFT | Top left channel.| 1176| TOP_SIDE_RIGHT | Top right channel.| 1177| BOTTOM_FRONT_CENTER | Bottom center front channel.| 1178| BOTTOM_FRONT_LEFT | Bottom left front channel.| 1179| BOTTOM_FRONT_RIGHT | Bottom right front channel.| 1180| AMBISONICS_ACN0 | Channel 0 for the zero-order stereo.| 1181| AMBISONICS_ACN1 | Channel 1 for the first-order stereo.| 1182| AMBISONICS_ACN2 | Channel 2 for the first-order stereo.| 1183| AMBISONICS_ACN3 | Channel 3 for the first-order stereo.| 1184| AMBISONICS_W | Equivalent to channel 0 for the zero-order stereo.| 1185| AMBISONICS_Y | Equivalent to channel 1 for the first-order stereo.| 1186| AMBISONICS_Z | Equivalent to channel 2 for the first-order stereo.| 1187| AMBISONICS_X | Equivalent to channel 3 for the first-order stereo.| 1188| AMBISONICS_ACN4 | Channel 4 for the second-order stereo.| 1189| AMBISONICS_ACN5 | Channel 5 for the second-order stereo.| 1190| AMBISONICS_ACN6 | Channel 6 for the second-order stereo.| 1191| AMBISONICS_ACN7 | Channel 7 for the second-order stereo.| 1192| AMBISONICS_ACN8 | Channel 8 for the second-order stereo.| 1193| AMBISONICS_ACN9 | Channel 9 for the third-order stereo.| 1194| AMBISONICS_ACN10 | Channel 10 for the third-order stereo.| 1195| AMBISONICS_ACN11 | Channel 11 for the third-order stereo.| 1196| AMBISONICS_ACN12 | Channel 12 for the third-order stereo.| 1197| AMBISONICS_ACN13 | Channel 13 for the third-order stereo.| 1198| AMBISONICS_ACN14 | Channel 14 for the third-order stereo.| 1199| AMBISONICS_ACN15 | Channel 15 for the third-order stereo.| 1200 1201 1202### OH_AACProfile 1203 1204``` 1205enum OH_AACProfile 1206``` 1207 1208**Description** 1209 1210Enumerates the AAC profiles. 1211 1212**System capability**: SystemCapability.Multimedia.Media.CodecBase 1213 1214**Since**: 9 1215 1216| Value| Description| 1217| -------- | -------- | 1218| AAC_PROFILE_LC | AAC profile of the low complexity level. | 1219| AAC_PROFILE_HE | AAC profile of the high efficiency level. <!--Del-->(This specification is not available yet.)<!--DelEnd--><br>**Since**: 14| 1220| AAC_PROFILE_HE_V2 | AAC profile of the high efficiency V2 level. <!--Del-->(This specification is not available yet.)<!--DelEnd--><br>**Since**: 14| 1221 1222 1223### OH_AVCLevel 1224 1225``` 1226enum OH_AVCLevel 1227``` 1228 1229**Description** 1230 1231Enumerates the AVC levels. 1232 1233**System capability**: SystemCapability.Multimedia.Media.CodecBase 1234 1235**Since**: 12 1236 1237| Value| Description| 1238| -------- | -------- | 1239| AVC_LEVEL_1 | Level 1. | 1240| AVC_LEVEL_1b | Level 1b. | 1241| AVC_LEVEL_11 | Level 1.1. | 1242| AVC_LEVEL_12 | Level 1.2. | 1243| AVC_LEVEL_13 | Level 1.3. | 1244| AVC_LEVEL_2 | Level 2. | 1245| AVC_LEVEL_21 | Level 2.1. | 1246| AVC_LEVEL_22 | Level 2.2. | 1247| AVC_LEVEL_3 | Level 3. | 1248| AVC_LEVEL_31 | Level 3.1. | 1249| AVC_LEVEL_32 | Level 3.2. | 1250| AVC_LEVEL_4 | Level 4. | 1251| AVC_LEVEL_41 | Level 4.1. | 1252| AVC_LEVEL_42 | Level 4.2. | 1253| AVC_LEVEL_5 | Level 5. | 1254| AVC_LEVEL_51 | Level 5.1. | 1255| AVC_LEVEL_52 | Level 5.2. | 1256| AVC_LEVEL_6 | Level 6. | 1257| AVC_LEVEL_61 | Level 6.1. | 1258| AVC_LEVEL_62 | Level 6.2. | 1259 1260 1261### OH_AVCProfile 1262 1263``` 1264enum OH_AVCProfile 1265``` 1266 1267**Description** 1268 1269Enumerates the AVC profiles. 1270 1271**System capability**: SystemCapability.Multimedia.Media.CodecBase 1272 1273**Since**: 9 1274 1275| Value| Description| 1276| -------- | -------- | 1277| AVC_PROFILE_BASELINE | AVC baseline profile. | 1278| AVC_PROFILE_HIGH | AVC high profile. | 1279| AVC_PROFILE_MAIN | AVC main profile. | 1280 1281 1282### OH_AVOutputFormat 1283 1284``` 1285enum OH_AVOutputFormat 1286``` 1287 1288**Description** 1289 1290Enumerates the output file formats supported by a muxer. 1291 1292**System capability**: SystemCapability.Multimedia.Media.CodecBase 1293 1294**Since**: 10 1295 1296| Value| Description| 1297| -------- | -------- | 1298| AV_OUTPUT_FORMAT_DEFAULT | Default format, which is MP4. | 1299| AV_OUTPUT_FORMAT_MPEG_4 | MP4. | 1300| AV_OUTPUT_FORMAT_M4A | M4A. | 1301| AV_OUTPUT_FORMAT_AMR | AMR.<br>**Since**: 12 | 1302| AV_OUTPUT_FORMAT_MP3 | MP3.<br>**Since**: 12 | 1303| AV_OUTPUT_FORMAT_WAV | WAV.<br>**Since**: 12 | 1304| AV_OUTPUT_FORMAT_AAC | AAC.<br>**Since**: 18 | 1305| AV_OUTPUT_FORMAT_FLAC | FLAC.<br>**Since**: 20 | 1306 1307### OH_AVSeekMode 1308 1309``` 1310enum OH_AVSeekMode 1311``` 1312 1313**Description** 1314 1315Enumerates the seek modes. 1316 1317**System capability**: SystemCapability.Multimedia.Media.CodecBase 1318 1319**Since**: 10 1320 1321| Value| Description| 1322| -------- | -------- | 1323| SEEK_MODE_NEXT_SYNC | Seeks to the next I-frame at the specified position. If there is no I-frame after the specified position, the seek operation may fail. | 1324| SEEK_MODE_PREVIOUS_SYNC | Seeks to the previous I-frame at the specified position. | 1325| SEEK_MODE_CLOSEST_SYNC | Seeks to the latest I-frame at the specified position. | 1326 1327 1328### OH_BitsPerSample 1329 1330``` 1331enum OH_BitsPerSample 1332``` 1333 1334**Description** 1335 1336Enumerates the number of audio bits for each coded sample. 1337 1338**System capability**: SystemCapability.Multimedia.Media.CodecBase 1339 1340**Since**: 10 1341 1342| Value| Description| 1343| -------- | -------- | 1344| SAMPLE_U8 | 8-bit unsigned integer sampling. | 1345| SAMPLE_S16LE | 16-bit signed integer sampling. | 1346| SAMPLE_S24LE | 24-bit signed integer sampling. | 1347| SAMPLE_S32LE | 32-bit signed integer sampling. | 1348| SAMPLE_F32LE | 32-bit floating-point sampling. | 1349| SAMPLE_U8P | 8-bit unsigned integer plane sampling. | 1350| SAMPLE_S16P | 16-bit signed integer plane sampling. | 1351| SAMPLE_S24P | 24-bit signed integer plane sampling. | 1352| SAMPLE_S32P | 32-bit signed integer plane sampling. | 1353| SAMPLE_F32P | 32-bit floating-point plane sampling. | 1354| INVALID_WIDTH | Invalid sampling format. | 1355 1356 1357### OH_ColorPrimary 1358 1359``` 1360enum OH_ColorPrimary 1361``` 1362 1363**Description** 1364 1365Enumerates the primary colors. This enum is used for both encoding and decoding. 1366 1367**System capability**: SystemCapability.Multimedia.Media.CodecBase 1368 1369**Since**: 10 1370 1371| Value| Description| 1372| -------- | -------- | 1373| COLOR_PRIMARY_BT709 | BT.709 color gamut. | 1374| COLOR_PRIMARY_UNSPECIFIED | Unspecified color gamut. | 1375| COLOR_PRIMARY_BT470_M | BT.470 System M color gamut. | 1376| COLOR_PRIMARY_BT601_625 | BT.601 625 color gamut. | 1377| COLOR_PRIMARY_BT601_525 | BT.601 525 color gamut. | 1378| COLOR_PRIMARY_SMPTE_ST240 | SMPTE ST 240 color gamut. | 1379| COLOR_PRIMARY_GENERIC_FILM | Generic film color gamut. | 1380| COLOR_PRIMARY_BT2020 | BT.2020 color gamut. | 1381| COLOR_PRIMARY_SMPTE_ST428 | SMPTE ST 428 color gamut. | 1382| COLOR_PRIMARY_P3DCI | DCI-P3 color gamut. | 1383| COLOR_PRIMARY_P3D65 | P3-D65 color gamut. | 1384 1385 1386### OH_HEVCLevel 1387 1388``` 1389enum OH_HEVCLevel 1390``` 1391 1392**Description** 1393 1394Enumerates the HEVC levels. 1395 1396**System capability**: SystemCapability.Multimedia.Media.CodecBase 1397 1398**Since**: 12 1399 1400| Value| Description| 1401| -------- | -------- | 1402| HEVC_LEVEL_1 | Level 1. | 1403| HEVC_LEVEL_2 | Level 2. | 1404| HEVC_LEVEL_21 | Level 2.1. | 1405| HEVC_LEVEL_3 | Level 3. | 1406| HEVC_LEVEL_31 | Level 3.1. | 1407| HEVC_LEVEL_4 | Level 4. | 1408| HEVC_LEVEL_41 | Level 4.1. | 1409| HEVC_LEVEL_5 | Level 5. | 1410| HEVC_LEVEL_51 | Level 5.1. | 1411| HEVC_LEVEL_52 | Level 5.2. | 1412| HEVC_LEVEL_6 | Level 6. | 1413| HEVC_LEVEL_61 | Level 6.1. | 1414| HEVC_LEVEL_62 | Level 6.2. | 1415 1416 1417### OH_HEVCProfile 1418 1419``` 1420enum OH_HEVCProfile 1421``` 1422 1423**Description** 1424 1425Enumerates the HEVC profiles. 1426 1427**System capability**: SystemCapability.Multimedia.Media.CodecBase 1428 1429**Since**: 10 1430 1431| Value| Description| 1432| -------- | -------- | 1433| HEVC_PROFILE_MAIN | HEVC profile of the main level. | 1434| HEVC_PROFILE_MAIN_10 | HEVC profile of the 10-bit main level. | 1435| HEVC_PROFILE_MAIN_STILL | HEVC profile of the main still picture level. | 1436| HEVC_PROFILE_MAIN_10_HDR10 | HEVC profile of the main 10 HDR10 level. (It is deprecated from API version 14.) | 1437| HEVC_PROFILE_MAIN_10_HDR10_PLUS | HEVC profile of the main 10 HDR10+ level. (It is deprecated from API version 14.) | 1438 1439 1440### OH_MatrixCoefficient 1441 1442``` 1443enum OH_MatrixCoefficient 1444``` 1445 1446**Description** 1447 1448Enumerates the matrix coefficients. This enum is used for both encoding and decoding. 1449 1450**System capability**: SystemCapability.Multimedia.Media.CodecBase 1451 1452**Since**: 10 1453 1454| Value| Description| 1455| -------- | -------- | 1456| MATRIX_COEFFICIENT_IDENTITY | Identity matrix. | 1457| MATRIX_COEFFICIENT_BT709 | BT.709 conversion matrix. | 1458| MATRIX_COEFFICIENT_UNSPECIFIED | Unspecified conversion matrix. | 1459| MATRIX_COEFFICIENT_FCC | FCC conversion matrix. | 1460| MATRIX_COEFFICIENT_BT601_625 | BT.601 625 conversion matrix. | 1461| MATRIX_COEFFICIENT_BT601_525 | BT.601 525 conversion matrix. | 1462| MATRIX_COEFFICIENT_SMPTE_ST240 | SMPTE ST 240 conversion matrix. | 1463| MATRIX_COEFFICIENT_YCGCO | YCgCo conversion matrix. | 1464| MATRIX_COEFFICIENT_BT2020_NCL | BT.2020 NCL conversion matrix. | 1465| MATRIX_COEFFICIENT_BT2020_CL | BT.2020 CL conversion matrix. | 1466| MATRIX_COEFFICIENT_SMPTE_ST2085 | SMPTE ST 2085 conversion matrix. | 1467| MATRIX_COEFFICIENT_CHROMATICITY_NCL | Chromaticity NCL conversion matrix. | 1468| MATRIX_COEFFICIENT_CHROMATICITY_CL | Chromaticity CL conversion matrix. | 1469| MATRIX_COEFFICIENT_ICTCP | ICTCP conversion matrix. | 1470 1471 1472### OH_MediaType 1473 1474``` 1475enum OH_MediaType 1476``` 1477 1478**Description** 1479 1480Enumerates the media types. 1481 1482**System capability**: SystemCapability.Multimedia.Media.CodecBase 1483 1484**Since**: 9 1485 1486| Value| Description| 1487| -------- | -------- | 1488| MEDIA_TYPE_AUD | Audio track. | 1489| MEDIA_TYPE_VID | Video track. | 1490| MEDIA_TYPE_SUBTITLE | Subtitle track.<br>**Since**: 12 | 1491| MEDIA_TYPE_TIMED_METADATA | Timed metadata track.<br>**Since**: 20 | 1492| MEDIA_TYPE_AUXILIARY | Auxiliary track.<br>**Since**: 20 | 1493 1494### OH_MPEG2Level 1495 1496``` 1497enum OH_MPEG2Level 1498``` 1499 1500**Description** 1501 1502Enumerates the MPEG2 levels. 1503 1504**System capability**: SystemCapability.Multimedia.Media.CodecBase 1505 1506**Since**: 17 1507 1508| Value| Description| 1509| -------- | -------- | 1510| MPEG2_LEVEL_LL | Low level.| 1511| MPEG2_LEVEL_ML | Main level.| 1512| MPEG2_LEVEL_H14 | High 1440 level.| 1513| MPEG2_LEVEL_HL | High level.| 1514 1515 1516### OH_MPEG2Profile 1517 1518``` 1519enum OH_MPEG2Profile 1520``` 1521 1522**Description** 1523 1524Enumerates the MPEG2 profiles. 1525 1526**System capability**: SystemCapability.Multimedia.Media.CodecBase 1527 1528**Since**: 17 1529 1530| Value| Description| 1531| -------- | -------- | 1532| MPEG2_PROFILE_SIMPLE | Simple profile.| 1533| MPEG2_PROFILE_MAIN | Main profile.| 1534| MPEG2_PROFILE_SNR | Signal-to-Noise Ratio (SNR) scalable profile.| 1535| MPEG2_PROFILE_SPATIAL | Spatial scalable profile.| 1536| MPEG2_PROFILE_HIGH | High profile.| 1537| MPEG2_PROFILE_422 | 4:2:2 profile.| 1538 1539 1540### OH_MPEG4Level 1541 1542``` 1543enum OH_MPEG4Level 1544``` 1545 1546**Description** 1547 1548Enumerates the MPEG4 levels. 1549 1550**System capability**: SystemCapability.Multimedia.Media.CodecBase 1551 1552**Since**: 17 1553 1554| Value| Description| 1555| -------- | -------- | 1556| MPEG4_LEVEL_0 | Level 0.| 1557| MPEG4_LEVEL_0B | Level 0B.| 1558| MPEG4_LEVEL_1 | Level 1.| 1559| MPEG4_LEVEL_2 | Level 2.| 1560| MPEG4_LEVEL_3 | Level 3.| 1561| MPEG4_LEVEL_3B | Level 3B.| 1562| MPEG4_LEVEL_4 | Level 4.| 1563| MPEG4_LEVEL_4A | Level 4A.| 1564| MPEG4_LEVEL_5 | Level 5.| 1565| MPEG4_LEVEL_6 | Level 6.| 1566 1567 1568### OH_MPEG4Profile 1569 1570``` 1571enum OH_MPEG4Profile 1572``` 1573 1574**Description** 1575 1576Enumerates the MPEG4 profiles. 1577 1578**System capability**: SystemCapability.Multimedia.Media.CodecBase 1579 1580**Since**: 17 1581 1582| Value| Description| 1583| -------- | -------- | 1584| MPEG4_PROFILE_SIMPLE | Simple profile.| 1585| MPEG4_PROFILE_SIMPLE_SCALABLE | Simple scalable profile.| 1586| MPEG4_PROFILE_CORE | Core profile.| 1587| MPEG4_PROFILE_MAIN | Main profile.| 1588| MPEG4_PROFILE_NBIT | N-bit profile.| 1589| MPEG4_PROFILE_HYBRID | Hybrid profile.| 1590| MPEG4_PROFILE_BASIC_ANIMATED_TEXTURE | Basic animated texture profile.| 1591| MPEG4_PROFILE_SCALABLE_TEXTURE | Scalable texture profile.| 1592| MPEG4_PROFILE_SIMPLE_FA | Simple FA profile.| 1593| MPEG4_PROFILE_ADVANCED_REAL_TIME_SIMPLE | Advanced real-time simple profile.| 1594| MPEG4_PROFILE_CORE_SCALABLE | Core scalable profile.| 1595| MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY | Advanced coding efficiency profile.| 1596| MPEG4_PROFILE_ADVANCED_CORE | Advanced core profile.| 1597| MPEG4_PROFILE_ADVANCED_SCALABLE_TEXTURE | Advanced scalable texture profile.| 1598| MPEG4_PROFILE_ADVANCED_SIMPLE | Advanced simple profile.| 1599 1600 1601### OH_ScalingMode 1602 1603``` 1604enum OH_ScalingMode 1605``` 1606 1607**Description** 1608 1609Enumerates the scaling modes. This enum is used only in surface mode. 1610 1611**System capability**: SystemCapability.Multimedia.Media.CodecBase 1612 1613**Since**: 10 1614 1615**Deprecated from**: 14 1616 1617**Substitute**: [OHScalingModeV2](../apis-arkgraphics2d/capi-external-window-h.md#ohscalingmodev2).OH_SCALING_MODE_SCALE_TO_WINDOW_V2 1618[OHScalingModeV2](../apis-arkgraphics2d/capi-external-window-h.md#ohscalingmodev2).OH_SCALING_MODE_SCALE_CROP_V2 1619 1620| Value| Description| 1621| -------- | -------- | 1622| SCALING_MODE_SCALE_TO_WINDOW | Scales the image based on the window size.| 1623| SCALING_MODE_SCALE_CROP | Crops the image based on the window size.| 1624 1625 1626 1627### OH_TemporalGopReferenceMode 1628 1629``` 1630enum OH_TemporalGopReferenceMode 1631``` 1632 1633**Description** 1634 1635Enumerates the reference modes of temporal image groups. 1636 1637**System capability**: SystemCapability.Multimedia.Media.CodecBase 1638 1639**Since**: 12 1640 1641| Value| Description| 1642| -------- | -------- | 1643| ADJACENT_REFERENCE | Refers to the nearest short-term reference frame. | 1644| JUMP_REFERENCE | Refers to the latest LTR frame. | 1645| UNIFORMLY_SCALED_REFERENCE | Drops video frames at the highest level, and evenly distributes the remaining frames. The number of temporal image groups must be a power of 2. | 1646 1647 1648### OH_VVCLevel 1649 1650``` 1651enum OH_VVCLevel 1652``` 1653 1654**Description** 1655 1656Enumerates the VVC levels. 1657 1658**System capability**: SystemCapability.Multimedia.Media.CodecBase 1659 1660**Since**: 15 1661 1662| Value| Description| 1663| -------- | -------- | 1664| VVC_LEVEL_1 | Level 1.0. | 1665| VVC_LEVEL_2 | Level 2.0. | 1666| VVC_LEVEL_21 | Level 2.1. | 1667| VVC_LEVEL_3 | Level 3.0. | 1668| VVC_LEVEL_31 | Level 3.1. | 1669| VVC_LEVEL_4 | Level 4.0. | 1670| VVC_LEVEL_41 | Level 4.1. | 1671| VVC_LEVEL_5 | Level 5.0. | 1672| VVC_LEVEL_51 | Level 5.1. | 1673| VVC_LEVEL_52 | Level 5.2. | 1674| VVC_LEVEL_6 | Level 6.0. | 1675| VVC_LEVEL_61 | Level 6.1. | 1676| VVC_LEVEL_62 | Level 6.2. | 1677| VVC_LEVEL_63 | Level 6.3. | 1678| VVC_LEVEL_155 | Level 15.5. | 1679 1680 1681### OH_VVCProfile 1682 1683``` 1684enum OH_VVCProfile 1685``` 1686 1687**Description** 1688 1689Enumerates the VVC profiles. 1690 1691**System capability**: SystemCapability.Multimedia.Media.CodecBase 1692 1693**Since**: 15 1694 1695| Value| Description| 1696| -------- | -------- | 1697| VVC_PROFILE_MAIN_10 | VVC profile of the 10-bit main level. | 1698| VVC_PROFILE_MAIN_12 | VVC profile of the 12-bit main level. | 1699| VVC_PROFILE_MAIN_12_INTRA | VVC profile of the 12-bit intra main level. | 1700| VVC_PROFILE_MULTI_MAIN_10 | VVC profile of the 10-bit main level for multi-layer encoding. | 1701| VVC_PROFILE_MAIN_10_444 | VVC profile of the 10-bit full-sample main level. | 1702| VVC_PROFILE_MAIN_12_444 | VVC profile of the 12-bit full-sample main level. | 1703| VVC_PROFILE_MAIN_16_444 | VVC profile of the 16-bit full-sample main level. | 1704| VVC_PROFILE_MAIN_12_444_INTRA | VVC profile of the 12-bit full-sample intra main level. | 1705| VVC_PROFILE_MAIN_16_444_INTRA | VVC profile of the 16-bit full-sample intra main level. | 1706| VVC_PROFILE_MULTI_MAIN_10_444 | VVC profile of the 10-bit full-sample main level for multi-layer encoding. | 1707| VVC_PROFILE_MAIN_10_STILL | VVC profile of the 10-bit still picture main level. | 1708| VVC_PROFILE_MAIN_12_STILL | VVC profile of the 12-bit still picture main level. | 1709| VVC_PROFILE_MAIN_10_444_STILL | VVC profile of the 10-bit full-sample still picture main level. | 1710| VVC_PROFILE_MAIN_12_444_STILL | VVC profile of the 12-bit full-sample still picture main level. | 1711| VVC_PROFILE_MAIN_16_444_STILL | VVC profile of the 16-bit full-sample still picture main level. | 1712 1713 1714### OH_H263Level 1715 1716``` 1717enum OH_H263Level 1718``` 1719 1720**Description** 1721 1722Enumerates the H.263 levels. 1723 1724**System capability**: SystemCapability.Multimedia.Media.CodecBase 1725 1726**Since**: 17 1727 1728| Value| Description| 1729| -------- | -------- | 1730| H263_LEVEL_10 | Level 10. | 1731| H263_LEVEL_20 | Level 20. | 1732| H263_LEVEL_30 | Level 30. | 1733| H263_LEVEL_40 | Level 40. | 1734| H263_LEVEL_45 | Level 45. | 1735| H263_LEVEL_50 | Level 50. | 1736| H263_LEVEL_60 | Level 60. | 1737| H263_LEVEL_70 | Level 70. | 1738 1739 1740### OH_H263Profile 1741 1742``` 1743enum OH_H263Profile 1744``` 1745 1746**Description** 1747 1748Enumerates the H.263 profiles. 1749 1750**System capability**: SystemCapability.Multimedia.Media.CodecBase 1751 1752**Since**: 17 1753 1754| Value| Description| 1755| -------- | -------- | 1756| H263_PROFILE_BASELINE | Baseline profile. | 1757| H263_PROFILE_VERSION_1_BACKWARD_COMPATIBILITY | Version 1 backward compatibility. | 1758 1759 1760### OH_TransferCharacteristic 1761 1762``` 1763enum OH_TransferCharacteristic 1764``` 1765 1766**Description** 1767 1768Enumerates the transfer characteristics. This enum is used for both encoding and decoding. 1769 1770**System capability**: SystemCapability.Multimedia.Media.CodecBase 1771 1772**Since**: 10 1773 1774| Value| Description| 1775| -------- | -------- | 1776| TRANSFER_CHARACTERISTIC_BT709 | BT.709 transfer function. | 1777| TRANSFER_CHARACTERISTIC_UNSPECIFIED | Unspecified transfer function. | 1778| TRANSFER_CHARACTERISTIC_GAMMA_2_2 | Gamma 2-2 transfer function. | 1779| TRANSFER_CHARACTERISTIC_GAMMA_2_8 | Gamma 2-8 transfer function. | 1780| TRANSFER_CHARACTERISTIC_BT601 | BT.601 transfer function. | 1781| TRANSFER_CHARACTERISTIC_SMPTE_ST240 | SMPTE ST 240 transfer function. | 1782| TRANSFER_CHARACTERISTIC_LINEAR | Linear transfer function. | 1783| TRANSFER_CHARACTERISTIC_LOG | Log transfer function. | 1784| TRANSFER_CHARACTERISTIC_LOG_SQRT | Log SQRT transfer function. | 1785| TRANSFER_CHARACTERISTIC_IEC_61966_2_4 | IEC61966-2.4 transfer function. | 1786| TRANSFER_CHARACTERISTIC_BT1361 | BT.1361 transfer function. | 1787| TRANSFER_CHARACTERISTIC_IEC_61966_2_1 | IEC61966 2.1 transfer function. | 1788| TRANSFER_CHARACTERISTIC_BT2020_10BIT | BT.2020 10-bit transfer function. | 1789| TRANSFER_CHARACTERISTIC_BT2020_12BIT | BT.2020 12-bit transfer function. | 1790| TRANSFER_CHARACTERISTIC_PQ | PQ transfer function. | 1791| TRANSFER_CHARACTERISTIC_SMPTE_ST428 | SMPTE ST.428 transfer function. | 1792| TRANSFER_CHARACTERISTIC_HLG | HLG transfer function. | 1793 1794 1795### OH_BitrateMode 1796 1797``` 1798enum OH_BitrateMode 1799``` 1800 1801**Description** 1802 1803Enumerates the bit rate modes of an encoder. 1804 1805**System capability**: SystemCapability.Multimedia.Media.CodecBase 1806 1807**Since**: 10 1808 1809| Value| Description| 1810| -------- | -------- | 1811| BITRATE_MODE_CBR | Constant bit rate. | 1812| BITRATE_MODE_VBR | Variable bit rate. The bit rate is for reference only. | 1813| BITRATE_MODE_CQ | Constant quality. | 1814| BITRATE_MODE_SQR<sup>20+</sup> | Stable quality. It is supported only for H.265 (HEVC). | 1815 1816## Variable Description 1817 1818 1819### OH_AVCODEC_MIMETYPE_SUBTITLE_SRT 1820 1821``` 1822const char* OH_AVCODEC_MIMETYPE_SUBTITLE_SRT 1823``` 1824 1825**Description** 1826 1827Pointer to the key that describes the MIME type of the SRT subtitle demuxer. 1828 1829**System capability**: SystemCapability.Multimedia.Media.CodecBase 1830 1831**Since**: 12 1832 1833 1834### OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT 1835 1836``` 1837const char* OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT 1838``` 1839 1840**Description** 1841 1842Pointer to the key that describes the MIME type of the WEBVTT subtitle demuxer. 1843 1844**System capability**: SystemCapability.Multimedia.Media.CodecBase 1845 1846**Since**: 12 1847 1848 1849### OH_AVCODEC_MIMETYPE_AUDIO_APE 1850 1851``` 1852const char* OH_AVCODEC_MIMETYPE_AUDIO_APE 1853``` 1854 1855**Description** 1856 1857Pointer to the key that describes the MIME type of the APE audio decoder. 1858 1859**System capability**: SystemCapability.Multimedia.Media.CodecBase 1860 1861**Since**: 12 1862 1863 1864### OH_AVCODEC_MIMETYPE_AUDIO_AAC 1865 1866``` 1867const char* OH_AVCODEC_MIMETYPE_AUDIO_AAC 1868``` 1869 1870**Description** 1871 1872Pointer to the key that describes the MIME type of the AAC audio codec. 1873 1874**System capability**: SystemCapability.Multimedia.Media.CodecBase 1875 1876**Since**: 9 1877 1878 1879### OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB 1880 1881``` 1882const char* OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB 1883``` 1884 1885**Description** 1886 1887Pointer to the key that describes the MIME type of the AMR-NB audio<!--RP4--><!--RP4End--> decoder. 1888 1889**System capability**: SystemCapability.Multimedia.Media.CodecBase 1890 1891**Since**: 11 1892 1893 1894### OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB 1895 1896``` 1897const char* OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB 1898``` 1899 1900**Description** 1901 1902Pointer to the key that describes the MIME type of the AMR-WB audio<!--RP4--><!--RP4End--> decoder. 1903 1904**System capability**: SystemCapability.Multimedia.Media.CodecBase 1905 1906**Since**: 11 1907 1908 1909### OH_AVCODEC_MIMETYPE_AUDIO_FLAC 1910 1911``` 1912const char* OH_AVCODEC_MIMETYPE_AUDIO_FLAC 1913``` 1914 1915**Description** 1916 1917Pointer to the key that describes the MIME type for FLAC audio codec. 1918 1919**System capability**: SystemCapability.Multimedia.Media.CodecBase 1920 1921**Since**: 10 1922 1923 1924### OH_AVCODEC_MIMETYPE_AUDIO_G711MU 1925 1926``` 1927const char* OH_AVCODEC_MIMETYPE_AUDIO_G711MU 1928``` 1929 1930**Description** 1931 1932Pointer to the key that describes the MIME type of the G.711 mu-law audio codec. 1933 1934**System capability**: SystemCapability.Multimedia.Media.CodecBase 1935 1936**Since**: 11 1937 1938 1939### OH_AVCODEC_MIMETYPE_AUDIO_G711A 1940 1941``` 1942const char *OH_AVCODEC_MIMETYPE_AUDIO_G711A 1943``` 1944 1945**Description** 1946 1947Pointer to the key that describes the MIME type of the G.711 a-law audio decoder. 1948 1949**System capability**: SystemCapability.Multimedia.Media.CodecBase 1950 1951**Since**: 20 1952 1953 1954### OH_AVCODEC_MIMETYPE_AUDIO_RAW 1955 1956``` 1957const char* OH_AVCODEC_MIMETYPE_AUDIO_RAW 1958``` 1959 1960**Description** 1961 1962Pointer to the key that describes the MIME type of raw audio streams. 1963 1964**System capability**: SystemCapability.Multimedia.Media.CodecBase 1965 1966**Since**: 18 1967 1968 1969### OH_AVCODEC_MIMETYPE_AUDIO_MPEG 1970 1971``` 1972const char* OH_AVCODEC_MIMETYPE_AUDIO_MPEG 1973``` 1974 1975**Description** 1976 1977Pointer to the key that describes the MIME type of the MP3 audio codec. 1978 1979**System capability**: SystemCapability.Multimedia.Media.CodecBase 1980 1981**Since**: 10 1982 1983 1984### OH_AVCODEC_MIMETYPE_AUDIO_OPUS 1985 1986``` 1987const char* OH_AVCODEC_MIMETYPE_AUDIO_OPUS 1988``` 1989 1990**Description** 1991 1992Pointer to the key that describes the MIME type of the Opus audio codec. <!--Del-->(This specification is not available yet.)<!--DelEnd--> 1993 1994**System capability**: SystemCapability.Multimedia.Media.CodecBase 1995 1996**Since**: 11 1997 1998 1999### OH_AVCODEC_MIMETYPE_AUDIO_VIVID 2000 2001``` 2002const char* OH_AVCODEC_MIMETYPE_AUDIO_VIVID 2003``` 2004 2005**Description** 2006 2007Pointer to the key that describes the MIME type of the Audio Vivid audio decoder. <!--Del-->(This specification is not available yet.)<!--DelEnd--> 2008 2009**System capability**: SystemCapability.Multimedia.Media.CodecBase 2010 2011**Since**: 11 2012 2013 2014### OH_AVCODEC_MIMETYPE_AUDIO_VORBIS 2015 2016``` 2017const char* OH_AVCODEC_MIMETYPE_AUDIO_VORBIS 2018``` 2019 2020**Description** 2021 2022Pointer to the key that describes the MIME type of the Vorbis audio decoder. 2023 2024**System capability**: SystemCapability.Multimedia.Media.CodecBase 2025 2026**Since**: 10 2027 2028 2029### OH_AVCODEC_MIMETYPE_IMAGE_BMP 2030 2031``` 2032const char* OH_AVCODEC_MIMETYPE_IMAGE_BMP 2033``` 2034 2035**Description** 2036 2037Pointer to the key that describes the MIME type of the BMP image encoder, which is used only for multiplexing BMP covers. 2038 2039**System capability**: SystemCapability.Multimedia.Media.CodecBase 2040 2041**Since**: 10 2042 2043 2044### OH_AVCODEC_MIMETYPE_IMAGE_JPG 2045 2046``` 2047const char* OH_AVCODEC_MIMETYPE_IMAGE_JPG 2048``` 2049 2050**Description** 2051 2052Pointer to the key that describes the MIME type of the JPG image encoder, which is used only for multiplexing JPG covers. 2053 2054**System capability**: SystemCapability.Multimedia.Media.CodecBase 2055 2056**Since**: 10 2057 2058 2059### OH_AVCODEC_MIMETYPE_IMAGE_PNG 2060 2061``` 2062const char* OH_AVCODEC_MIMETYPE_IMAGE_PNG 2063``` 2064 2065**Description** 2066 2067Pointer to the key that describes the MIME type of the PNG image encoder, which is used only for multiplexing PNG covers. 2068 2069**System capability**: SystemCapability.Multimedia.Media.CodecBase 2070 2071**Since**: 10 2072 2073 2074### OH_AVCODEC_MIMETYPE_VIDEO_AVC 2075 2076``` 2077const char* OH_AVCODEC_MIMETYPE_VIDEO_AVC 2078``` 2079 2080**Description** 2081 2082Pointer to the key that describes the MIME type of the AVC (H.264) video codec. 2083 2084**System capability**: SystemCapability.Multimedia.Media.CodecBase 2085 2086**Since**: 9 2087 2088 2089### OH_AVCODEC_MIMETYPE_VIDEO_HEVC 2090 2091``` 2092const char* OH_AVCODEC_MIMETYPE_VIDEO_HEVC 2093``` 2094 2095**Description** 2096 2097Pointer to the key that describes the MIME type of the HEVC (H.265) video codec. 2098 2099**System capability**: SystemCapability.Multimedia.Media.CodecBase 2100 2101**Since**: 10 2102 2103 2104### OH_AVCODEC_MIMETYPE_VIDEO_VVC 2105 2106``` 2107const char* OH_AVCODEC_MIMETYPE_VIDEO_VVC 2108``` 2109 2110**Description** 2111 2112Pointer to the key that describes the MIME type of the VVC (H.266) video codec. 2113 2114**System capability**: SystemCapability.Multimedia.Media.CodecBase 2115 2116**Since**: 12 2117 2118 2119### OH_AVCODEC_MIMETYPE_VIDEO_H263 2120 2121``` 2122const char* OH_AVCODEC_MIMETYPE_VIDEO_H263 2123``` 2124 2125**Description** 2126 2127Pointer to the key that describes the MIME type of the H.263 video codec. 2128 2129**System capability**: SystemCapability.Multimedia.Media.CodecBase 2130 2131**Since**: 17 2132 2133 2134### OH_AVCODEC_MIMETYPE_VIDEO_MPEG2 2135 2136``` 2137const char* OH_AVCODEC_MIMETYPE_VIDEO_MPEG2 2138``` 2139 2140**Description** 2141 2142Pointer to the key that describes the MIME type of MPEG2 video codec. 2143 2144**System capability**: SystemCapability.Multimedia.Media.CodecBase 2145 2146**Since**: 17 2147 2148 2149### OH_AVCODEC_MIMETYPE_VIDEO_MPEG4 2150 2151``` 2152const char* OH_AVCODEC_MIMETYPE_VIDEO_MPEG4 2153``` 2154 2155**Description** 2156 2157Pointer to the key that describes the MIME type of the MPEG4 video encoder, which is used only for multiplexing MPEG4 video streams. 2158 2159**System capability**: SystemCapability.Multimedia.Media.CodecBase 2160 2161**Since**: 10 2162 2163**Deprecated from**: 11 2164 2165**Substitute**: [OH_AVCODEC_MIMETYPE_VIDEO_MPEG4_PART2](#oh_avcodec_mimetype_video_mpeg4_part2) 2166 2167 2168### OH_AVCODEC_MIMETYPE_VIDEO_MPEG4_PART2 2169 2170``` 2171const char* OH_AVCODEC_MIMETYPE_VIDEO_MPEG4_PART2 2172``` 2173 2174**Description** 2175 2176Pointer to the key that describes the MIME type of MPEG4 Part 2 video codec. 2177 2178**System capability**: SystemCapability.Multimedia.Media.CodecBase 2179 2180**Since**: 17 2181 2182 2183### OH_ED_KEY_EOS 2184 2185``` 2186const char* OH_ED_KEY_EOS 2187``` 2188 2189**Description** 2190 2191Pointer to the key that describes the end of stream for the surface buffer. The value type is int32_t. 2192 2193**System capability**: SystemCapability.Multimedia.Media.CodecBase 2194 2195**Since**: 9 2196 2197**Deprecated from**: 14 2198 2199 2200### OH_ED_KEY_TIME_STAMP 2201 2202``` 2203const char* OH_ED_KEY_TIME_STAMP 2204``` 2205 2206**Description** 2207 2208Pointer to the key that describes the surface buffer timestamp. The value is of the int64_t type. 2209 2210**System capability**: SystemCapability.Multimedia.Media.CodecBase 2211 2212**Since**: 9 2213 2214**Deprecated from**: 14 2215 2216 2217### OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT 2218 2219``` 2220const char* OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT 2221``` 2222 2223**Description** 2224 2225Pointer to the key that describes the maximum number of LTR frames obtained during video encoding. The value type is int32_t. 2226 2227You can use the API [OH_AVCapability_GetFeatureProperties](_a_v_capability.md#oh_avcapability_getfeatureproperties) and the enum [VIDEO_ENCODER_LONG_TERM_REFERENCE](_a_v_capability.md#oh_avcapabilityfeature-1) to query the maximum number. 2228 2229**System capability**: SystemCapability.Multimedia.Media.CodecBase 2230 2231**Since**: 12 2232 2233 2234### OH_MD_KEY_AAC_IS_ADTS 2235 2236``` 2237const char* OH_MD_KEY_AAC_IS_ADTS 2238``` 2239 2240**Description** 2241 2242Pointer to the key that describes the AAC format, which can be ADTS or LATM. The value type is int32_t. The value **0** means the LATM format, and **1** means the ADTS format. This key is supported by AAC decoders. 2243 2244**System capability**: SystemCapability.Multimedia.Media.CodecBase 2245 2246**Since**: 10 2247 2248 2249### OH_MD_KEY_ALBUM 2250 2251``` 2252const char* OH_MD_KEY_ALBUM 2253``` 2254 2255**Description** 2256 2257Pointer to the key that describes the album in a media file. The value type is string. 2258 2259**System capability**: SystemCapability.Multimedia.Media.CodecBase 2260 2261**Since**: 10 2262 2263 2264### OH_MD_KEY_ALBUM_ARTIST 2265 2266``` 2267const char* OH_MD_KEY_ALBUM_ARTIST 2268``` 2269 2270**Description** 2271 2272Pointer to the key that describes the album artist in a media file. The value type is string. 2273 2274**System capability**: SystemCapability.Multimedia.Media.CodecBase 2275 2276**Since**: 10 2277 2278 2279### OH_MD_KEY_ARTIST 2280 2281``` 2282const char* OH_MD_KEY_ARTIST 2283``` 2284 2285**Description** 2286 2287Pointer to the key that describes lyrics in a media file. The value type is string. 2288 2289**System capability**: SystemCapability.Multimedia.Media.CodecBase 2290 2291**Since**: 10 2292 2293 2294### OH_MD_KEY_AUD_CHANNEL_COUNT 2295 2296``` 2297const char* OH_MD_KEY_AUD_CHANNEL_COUNT 2298``` 2299 2300**Description** 2301 2302Pointer to the key that describes the number of audio channels. The value type is int32_t. 2303 2304**System capability**: SystemCapability.Multimedia.Media.CodecBase 2305 2306**Since**: 9 2307 2308 2309### OH_MD_KEY_AUD_SAMPLE_RATE 2310 2311``` 2312const char* OH_MD_KEY_AUD_SAMPLE_RATE 2313``` 2314 2315**Description** 2316 2317Pointer to the key that describes the audio sampling rate. The value type is int32_t. 2318 2319**System capability**: SystemCapability.Multimedia.Media.CodecBase 2320 2321**Since**: 9 2322 2323 2324### OH_MD_KEY_AUDIO_COMPRESSION_LEVEL 2325 2326``` 2327const char* OH_MD_KEY_AUDIO_COMPRESSION_LEVEL 2328``` 2329 2330**Description** 2331 2332Pointer to the key that describes the audio codec compression level. The value type is int32_t type. This key is used only for audio encoding. 2333 2334**System capability**: SystemCapability.Multimedia.Media.CodecBase 2335 2336**Since**: 11 2337 2338 2339### OH_MD_KEY_AUDIO_OBJECT_NUMBER 2340 2341``` 2342const char* OH_MD_KEY_AUDIO_OBJECT_NUMBER 2343``` 2344 2345**Description** 2346 2347Pointer to the key that describes the number of audio objects. The value type is int32_t. This key is used only for Audio Vivid decoding. 2348 2349**System capability**: SystemCapability.Multimedia.Media.CodecBase 2350 2351**Since**: 11 2352 2353 2354### OH_MD_KEY_AUDIO_SAMPLE_FORMAT 2355 2356``` 2357const char* OH_MD_KEY_AUDIO_SAMPLE_FORMAT 2358``` 2359 2360**Description** 2361 2362Pointer to the key that describes the original audio format. The value type is int32_t. For details, see [OH_BitsPerSample](#oh_bitspersample-1). 2363 2364**System capability**: SystemCapability.Multimedia.Media.CodecBase 2365 2366**Since**: 9 2367 2368 2369### OH_MD_KEY_AUDIO_VIVID_METADATA 2370 2371``` 2372const char* OH_MD_KEY_AUDIO_VIVID_METADATA 2373``` 2374 2375**Description** 2376 2377Pointer to the key that describes the Audio Vivid metadata. The value type is uint8_t\*. This key is used only for Audio Vivid decoding. 2378 2379**System capability**: SystemCapability.Multimedia.Media.CodecBase 2380 2381**Since**: 11 2382 2383 2384### OH_MD_KEY_BITRATE 2385 2386``` 2387const char* OH_MD_KEY_BITRATE 2388``` 2389 2390**Description** 2391 2392Pointer to the key that describes the bit rate. The value type is int64_t. 2393 2394You can call [OH_AVCapability_GetEncoderBitrateRange](_a_v_capability.md#oh_avcapability_getencoderbitraterange) to obtain the value range. 2395 2396**System capability**: SystemCapability.Multimedia.Media.CodecBase 2397 2398**Since**: 9 2399 2400 2401### OH_MD_KEY_BITS_PER_CODED_SAMPLE 2402 2403``` 2404const char* OH_MD_KEY_BITS_PER_CODED_SAMPLE 2405``` 2406 2407**Description** 2408Pointer to the key that describes the number of bits per sample. The value type is int32_t. 2409 2410In versions earlier than API version 20, this parameter must be set to **1** for FLAC encoding. Otherwise, **OH_AudioCodec_Configure** returns the error code **AV_ERR_INVALID_VAL**. However, this parameter has no actual effect and does not affect the encoding result. Starting from API version 20, you do not need to set it anymore. 2411 2412**System capability**: SystemCapability.Multimedia.Media.CodecBase 2413 2414**Since**: 10 2415 2416 2417### OH_MD_KEY_CHANNEL_LAYOUT 2418 2419``` 2420const char* OH_MD_KEY_CHANNEL_LAYOUT 2421``` 2422 2423**Description** 2424 2425Pointer to the key that describes the required encoding channel layout. The value type is int64_t. This key applies only to encoders. 2426For details, see [OH_AudioChannelLayout](_core.md#oh_audiochannellayout-1). 2427 2428**System capability**: SystemCapability.Multimedia.Media.CodecBase 2429 2430**Since**: 10 2431 2432 2433### OH_MD_KEY_CODEC_CONFIG 2434 2435``` 2436const char* OH_MD_KEY_CODEC_CONFIG 2437``` 2438 2439**Description** 2440 2441Pointer to the key that describes the codec-specific data. In the case of video, data carried in **SPS/PPS** is transferred. In the case of audio, data carried in **extraData** is transferred. The value type is uint8_t\*. <!--Del-->(This key is not supported yet for the video codec.)<!--DelEnd--> 2442 2443**System capability**: SystemCapability.Multimedia.Media.CodecBase 2444 2445**Since**: 10 2446 2447 2448### OH_MD_KEY_CODEC_MIME 2449 2450``` 2451const char* OH_MD_KEY_CODEC_MIME 2452``` 2453 2454**Description** 2455 2456Pointer to the key that describes the [MIME](#media-codec-formats) type of the codec. The value type is string. 2457 2458**System capability**: SystemCapability.Multimedia.Media.CodecBase 2459 2460**Since**: 9 2461 2462 2463### OH_MD_KEY_COLOR_PRIMARIES 2464 2465``` 2466const char* OH_MD_KEY_COLOR_PRIMARIES 2467``` 2468 2469**Description** 2470 2471Pointer to the key that describes the video primary colors. The value type is int32_t. The default value is **COLOR_PRIMARY_UNSPECIFIED**. For details, see [OH_ColorPrimary](#oh_colorprimary). The value complies with Table 2 in H.273. 2472 2473**System capability**: SystemCapability.Multimedia.Media.CodecBase 2474 2475**Since**: 10 2476 2477 2478### OH_MD_KEY_COMMENT 2479 2480``` 2481const char* OH_MD_KEY_COMMENT 2482``` 2483 2484**Description** 2485 2486Pointer to the key that describes the comment in a media file. The value type is string. 2487 2488**System capability**: SystemCapability.Multimedia.Media.CodecBase 2489 2490**Since**: 10 2491 2492 2493### OH_MD_KEY_COMPLIANCE_LEVEL 2494 2495``` 2496const char* OH_MD_KEY_COMPLIANCE_LEVEL 2497``` 2498 2499**Description** 2500 2501Pointer to the key that describes the FLAC compliance level. The value type is int32_t. This key is used only for audio encoding. 2502 2503**System capability**: SystemCapability.Multimedia.Media.CodecBase 2504 2505**Since**: 10 2506 2507 2508### OH_MD_KEY_COPYRIGHT 2509 2510``` 2511const char* OH_MD_KEY_COPYRIGHT 2512``` 2513 2514**Description** 2515 2516Pointer to the key that describes the copyright in a media file. The value type is string. 2517 2518**System capability**: SystemCapability.Multimedia.Media.CodecBase 2519 2520**Since**: 10 2521 2522 2523### OH_MD_KEY_DATE 2524 2525``` 2526const char* OH_MD_KEY_DATE 2527``` 2528 2529**Description** 2530 2531Pointer to the key that describes the date in a media file, for example, 2024. The value type is string. 2532 2533**System capability**: SystemCapability.Multimedia.Media.CodecBase 2534 2535**Since**: 10 2536 2537 2538### OH_MD_KEY_DESCRIPTION 2539 2540``` 2541const char* OH_MD_KEY_DESCRIPTION 2542``` 2543 2544**Description** 2545 2546Pointer to the key that describes the description in a media file. The value type is string. 2547 2548**System capability**: SystemCapability.Multimedia.Media.CodecBase 2549 2550**Since**: 10 2551 2552 2553### OH_MD_KEY_DURATION 2554 2555``` 2556const char* OH_MD_KEY_DURATION 2557``` 2558 2559**Description** 2560 2561Pointer to the key that describes the duration in a media file, in microseconds. The value type is int64_t. 2562 2563**System capability**: SystemCapability.Multimedia.Media.CodecBase 2564 2565**Since**: 9 2566 2567 2568### OH_MD_KEY_FRAME_RATE 2569 2570``` 2571const char* OH_MD_KEY_FRAME_RATE 2572``` 2573 2574**Description** 2575 2576Pointer to the key that describes the video frame rate. The value type is double. The value must be greater than **0**. 2577 2578You can call [OH_AVCapability_GetVideoFrameRateRange](_a_v_capability.md#oh_avcapability_getvideoframeraterange) to obtain the value range. 2579 2580**System capability**: SystemCapability.Multimedia.Media.CodecBase 2581 2582**Since**: 9 2583 2584 2585### OH_MD_KEY_GENRE 2586 2587``` 2588const char* OH_MD_KEY_GENRE 2589``` 2590 2591**Description** 2592 2593Pointer to the key that describes the genre in a media file. The value type is string. 2594 2595**System capability**: SystemCapability.Multimedia.Media.CodecBase 2596 2597**Since**: 10 2598 2599 2600### OH_MD_KEY_HEIGHT 2601 2602``` 2603const char* OH_MD_KEY_HEIGHT 2604``` 2605 2606**Description** 2607 2608Pointer to the key that describes the video height. The value type is int32_t. 2609 2610This key is used to set the display height of a video frame when **Configure** is called during video encoding and decoding. 2611 2612You can call [OH_AVCapability_GetVideoHeightRange](_a_v_capability.md#oh_avcapability_getvideoheightrange) to obtain the value range. 2613 2614For details about the development guide, see step 5 in surface mode or step 4 in buffer mode in [Video Encoding](../../media/avcodec/video-encoding.md). 2615 2616**System capability**: SystemCapability.Multimedia.Media.CodecBase 2617 2618**Since**: 9 2619 2620 2621### OH_MD_KEY_I_FRAME_INTERVAL 2622 2623``` 2624const char* OH_MD_KEY_I_FRAME_INTERVAL 2625``` 2626 2627**Description** 2628 2629Pointer to the key that describes the key frame interval, in milliseconds. The value type is int32_t. This key is optional and is used only for video encoding. 2630 2631A negative value means that only the first frame is a keyframe. The value **0** means that all frames are keyframes. A positive value means one keyframe every (frameRate * value)/1000 frames. The default value is **1000**. 2632 2633**System capability**: SystemCapability.Multimedia.Media.CodecBase 2634 2635**Since**: 9 2636 2637 2638### OH_MD_KEY_IDENTIFICATION_HEADER 2639 2640``` 2641const char* OH_MD_KEY_IDENTIFICATION_HEADER 2642``` 2643 2644**Description** 2645 2646Pointer to the key that describes the Vorbis identification header. The value type is uint8_t. This key applies only to Vorbis decoders. 2647 2648**System capability**: SystemCapability.Multimedia.Media.CodecBase 2649 2650**Since**: 10 2651 2652 2653### OH_MD_KEY_LANGUAGE 2654 2655``` 2656const char* OH_MD_KEY_LANGUAGE 2657``` 2658 2659**Description** 2660 2661Pointer to the key that describes the language in a media file. The value type is string. 2662 2663**System capability**: SystemCapability.Multimedia.Media.CodecBase 2664 2665**Since**: 10 2666 2667 2668### OH_MD_KEY_LYRICS 2669 2670``` 2671const char* OH_MD_KEY_LYRICS 2672``` 2673 2674**Description** 2675 2676Pointer to the key that describes the lyrics in a media file. The value type is string. 2677 2678**System capability**: SystemCapability.Multimedia.Media.CodecBase 2679 2680**Since**: 10 2681 2682 2683### OH_MD_KEY_MATRIX_COEFFICIENTS 2684 2685``` 2686const char* OH_MD_KEY_MATRIX_COEFFICIENTS 2687``` 2688 2689**Description** 2690 2691Pointer to the key that describes the video matrix coefficients. The value type is int32_t. The default value is **MATRIX_COEFFICIENT_UNSPECIFIED**. For details, see [OH_MatrixCoefficient](#oh_matrixcoefficient). The value must comply with Table 4 in H.273. 2692 2693**System capability**: SystemCapability.Multimedia.Media.CodecBase 2694 2695**Since**: 10 2696 2697 2698### OH_MD_KEY_MAX_INPUT_SIZE 2699 2700``` 2701const char* OH_MD_KEY_MAX_INPUT_SIZE 2702``` 2703 2704**Description** 2705 2706Pointer to the key that describes the maximum size of an input stream to decode. The value type is int32_t. 2707 2708**System capability**: SystemCapability.Multimedia.Media.CodecBase 2709 2710**Since**: 9 2711 2712 2713### OH_MD_KEY_PIXEL_FORMAT 2714 2715``` 2716const char* OH_MD_KEY_PIXEL_FORMAT 2717``` 2718 2719**Description** 2720 2721Pointer to the key that describes the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat). 2722 2723**System capability**: SystemCapability.Multimedia.Media.CodecBase 2724 2725**Since**: 9 2726 2727 2728### OH_MD_KEY_PROFILE 2729 2730``` 2731const char* OH_MD_KEY_PROFILE 2732``` 2733 2734**Description** 2735 2736Pointer to the key that describes the encoding grading. The value type is int32_t. For details, see [OH_AVCProfile](#oh_avcprofile), [OH_HEVCProfile](#oh_hevcprofile), and [OH_AACProfile](#oh_aacprofile). 2737 2738You can call [OH_AVCapability_GetSupportedProfiles](_a_v_capability.md#oh_avcapability_getsupportedprofiles) to obtain the supported profiles. 2739 2740**System capability**: SystemCapability.Multimedia.Media.CodecBase 2741 2742**Since**: 9 2743 2744 2745### OH_MD_KEY_QUALITY 2746 2747``` 2748const char* OH_MD_KEY_QUALITY 2749``` 2750 2751**Description** 2752 2753Pointer to the key that describes the required encoding quality. The value type is int32_t. The default value is **50**. In H.264 and H.265 encoding scenarios, the value range can be obtained by calling [OH_AVCapability_GetEncoderQualityRange](_a_v_capability.md#oh_avcapability_getencoderqualityrange). This key applies only to the encoder in constant quality mode. 2754 2755**System capability**: SystemCapability.Multimedia.Media.CodecBase 2756 2757**Since**: 10 2758 2759 2760### OH_MD_KEY_RANGE_FLAG 2761 2762``` 2763const char* OH_MD_KEY_RANGE_FLAG 2764``` 2765 2766**Description** 2767 2768Pointer to the key that describes the video YUV value range flag. The value type is int32_t. The value **1** means a full range, and **0** means a limited range. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. 2769 2770**System capability**: SystemCapability.Multimedia.Media.CodecBase 2771 2772**Since**: 10 2773 2774 2775### OH_MD_KEY_REQUEST_I_FRAME 2776 2777``` 2778const char* OH_MD_KEY_REQUEST_I_FRAME 2779``` 2780 2781**Description** 2782 2783Pointer to the key that describes the request for immediate encoding of I-frames. The value type is int32_t. This key is used in **OH_VideoEncoder_SetParameter()** or takes effect immediately with each frame. 2784 2785**System capability**: SystemCapability.Multimedia.Media.CodecBase 2786 2787**Since**: 10 2788 2789 2790### OH_MD_KEY_ROTATION 2791 2792``` 2793const char* OH_MD_KEY_ROTATION 2794``` 2795 2796**Description** 2797 2798Pointer to the key that describes the rotation angle of the surface. The value type is int32_t, and the value range is {0, 90, 180, 270}. The default value is 0. This key is used only for video decoding surface mode. 2799 2800**System capability**: SystemCapability.Multimedia.Media.CodecBase 2801 2802**Since**: 9 2803 2804 2805### OH_MD_KEY_SBR 2806 2807``` 2808const char* OH_MD_KEY_SBR 2809``` 2810 2811**Description** 2812 2813Pointer to the key that describes the AAC SBR format. The value type is int32_t. This key applies to AAC encoders. 2814 2815**System capability**: SystemCapability.Multimedia.Media.CodecBase 2816 2817**Since**: 10 2818 2819 2820### OH_MD_KEY_SCALING_MODE 2821 2822``` 2823const char* OH_MD_KEY_SCALING_MODE 2824``` 2825 2826**Description** 2827 2828Pointer to the key that describes the video scaling mode. The value type is int32_t. For details, see [OH_ScalingMode](#oh_scalingmode). You are advised to set the scaling mode by calling [OH_NativeWindow_NativeWindowSetScalingModeV2](../apis-arkgraphics2d/capi-external-window-h.md#oh_nativewindow_nativewindowsetscalingmodev2). This key is optional and is used only for video decoding in surface mode. 2829 2830**System capability**: SystemCapability.Multimedia.Media.CodecBase 2831 2832**Since**: 10 2833 2834**Deprecated from**: 14 2835 2836**Substitute**: [OH_NativeWindow_NativeWindowSetScalingModeV2](../apis-arkgraphics2d/capi-external-window-h.md#oh_nativewindow_nativewindowsetscalingmodev2) 2837 2838 2839### OH_MD_KEY_SETUP_HEADER 2840 2841``` 2842const char* OH_MD_KEY_SETUP_HEADER 2843``` 2844 2845**Description** 2846 2847Pointer to the key that describes the Vorbis setup header. The value type is uint8_t. This key applies only to Vorbis decoders. 2848 2849**System capability**: SystemCapability.Multimedia.Media.CodecBase 2850 2851**Since**: 10 2852 2853 2854### OH_MD_KEY_TITLE 2855 2856``` 2857const char* OH_MD_KEY_TITLE 2858``` 2859 2860**Description** 2861 2862Pointer to the key that describes the title in a media file. The value type is string. 2863 2864**System capability**: SystemCapability.Multimedia.Media.CodecBase 2865 2866**Since**: 10 2867 2868 2869### OH_MD_KEY_TRACK_COUNT 2870 2871``` 2872const char* OH_MD_KEY_TRACK_COUNT 2873``` 2874 2875**Description** 2876 2877Pointer to the key that describes the number of tracks in a media file. The value type is int32_t. 2878 2879**System capability**: SystemCapability.Multimedia.Media.CodecBase 2880 2881**Since**: 10 2882 2883 2884### OH_MD_KEY_TRACK_TYPE 2885 2886``` 2887const char* OH_MD_KEY_TRACK_TYPE 2888``` 2889 2890**Description** 2891 2892Pointer to the key that describes the track type in a media file. The value type is int32_t. For details, see [OH_MediaType](#oh_mediatype-1). 2893 2894**System capability**: SystemCapability.Multimedia.Media.CodecBase 2895 2896**Since**: 9 2897 2898 2899### OH_MD_KEY_TRANSFER_CHARACTERISTICS 2900 2901``` 2902const char* OH_MD_KEY_TRANSFER_CHARACTERISTICS 2903``` 2904 2905**Description** 2906 2907Pointer to the key that describes the video transfer characteristics. The value type is int32_t. The default value is **MATRIX_COEFFICIENT_UNSPECIFIED**. For details, see [OH_TransferCharacteristic](#oh_transfercharacteristic). The value complies with Table 3 in H.273. 2908 2909**System capability**: SystemCapability.Multimedia.Media.CodecBase 2910 2911**Since**: 10 2912 2913### OH_MD_KEY_VIDEO_CROP_BOTTOM 2914 2915``` 2916const char* OH_MD_KEY_VIDEO_CROP_BOTTOM 2917``` 2918 2919**Description** 2920 2921Pointer to the key that describes the bottom coordinate (y) of the cropped rectangle. The value type is int32_t. The row at the bottom of the cropped rectangle is contained, and the row index starts from 0. This key is used only for video decoding. 2922 2923**System capability**: SystemCapability.Multimedia.Media.CodecBase 2924 2925**Since**: 12 2926 2927 2928### OH_MD_KEY_VIDEO_CROP_LEFT 2929 2930``` 2931const char* OH_MD_KEY_VIDEO_CROP_LEFT 2932``` 2933 2934**Description** 2935 2936Pointer to the key that describes the left coordinate (x) of the cropped rectangle. The value type is int32_t. The leftmost column of the cropped rectangle is contained, and the column index starts from 0. This key is used only for video decoding. 2937 2938**System capability**: SystemCapability.Multimedia.Media.CodecBase 2939 2940**Since**: 12 2941 2942 2943### OH_MD_KEY_VIDEO_CROP_RIGHT 2944 2945``` 2946const char* OH_MD_KEY_VIDEO_CROP_RIGHT 2947``` 2948 2949**Description** 2950 2951Pointer to the key that describes the right coordinate (x) of the cropped rectangle. The value type is int32_t. The rightmost column of the cropped rectangle is contained, and the column index starts from 0. This key is used only for video decoding. 2952 2953**System capability**: SystemCapability.Multimedia.Media.CodecBase 2954 2955**Since**: 12 2956 2957 2958### OH_MD_KEY_VIDEO_CROP_TOP 2959 2960``` 2961const char* OH_MD_KEY_VIDEO_CROP_TOP 2962``` 2963 2964**Description** 2965 2966Pointer to the key that describes the top coordinate (y) of the cropped rectangle. The value type is int32_t. The row at the top of the cropped rectangle is contained, and the row index starts from 0. This key is used only for video decoding. 2967 2968**System capability**: SystemCapability.Multimedia.Media.CodecBase 2969 2970**Since**: 12 2971 2972 2973### OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY 2974 2975``` 2976const char* OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY 2977``` 2978 2979**Description** 2980 2981Pointer to the key that describes the enabled status of low-latency video decoding. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and used only in the configuration phase. 2982 2983If enabled, the input and output data held by the video decoder does not exceed the amount required by the decoder standard. 2984 2985You can call [OH_AVCapability_IsFeatureSupported](_a_v_capability.md#oh_avcapability_isfeaturesupported) to check whether a specific decoder supports low-latency decoding. If supported, the video decoder outputs frames in the decoding sequence when low-latency video codec is enabled. 2986 2987 2988**System capability**: SystemCapability.Multimedia.Media.CodecBase 2989 2990**Since**: 12 2991 2992 2993### OH_MD_KEY_ENABLE_SYNC_MODE 2994 2995``` 2996const char* OH_MD_KEY_ENABLE_SYNC_MODE 2997``` 2998 2999**Description** 3000 3001Pointer to the key that describes the enabled status of audio/video codec synchronization. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional. 3002 3003If this feature is enabled, pay attention to the following: 30041. The codec cannot have a callback function. 30052. You must use the buffer query API instead of the callback function. 30063. The key can be used only in the configuration phase. 3007 3008**System capability**: SystemCapability.Multimedia.Media.CodecBase 3009 3010**Since**: 20 3011 3012 3013### OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE 3014 3015``` 3016const char* OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE 3017``` 3018 3019**Description** 3020 3021Pointer to the key that describes the video encoding bit rate mode. The value type is int32_t. For details, see [OH_BitrateMode](#oh_bitratemode-1). 3022 3023**System capability**: SystemCapability.Multimedia.Media.CodecBase 3024 3025**Since**: 9 3026 3027### OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY 3028 3029``` 3030const char* OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY 3031``` 3032 3033**Description** 3034 3035Pointer to the key that describes the enabled status of temporal scalability. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. 3036 3037Before using this key, you can use the API [OH_AVCapability_IsFeatureSupported](_a_v_capability.md#oh_avcapability_isfeaturesupported) and the enum [VIDEO_ENCODER_TEMPORAL_SCALABILITY](_a_v_capability.md#oh_avcapabilityfeature-1) to check whether the video encoder supports temporal scalability. 3038 3039For details, see [Temporally Scalable Video Coding](../../media/avcodec/video-encoding-temporal-scalability.md#available-apis). 3040 3041This key is optional and used only in the configuration phase of video encoding. 3042 3043**System capability**: SystemCapability.Multimedia.Media.CodecBase 3044 3045**Since**: 12 3046 3047 3048### OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT 3049 3050``` 3051const char* OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT 3052``` 3053**Description** 3054 3055Pointer to the key that describes the number of LTR frames. The value type is int32_t. The value must be within the supported value range. 3056 3057Before using this key, you can use the API [OH_AVCapability_GetFeatureProperties](_a_v_capability.md#oh_avcapability_getfeatureproperties) and the enum [VIDEO_ENCODER_LONG_TERM_REFERENCE](_a_v_capability.md#oh_avcapabilityfeature-1) to query the number of supported LTR frames. 3058 3059This key is optional and used only in the configuration phase of video encoding. 3060 3061For details, see [Temporally Scalable Video Coding](../../media/avcodec/video-encoding-temporal-scalability.md#available-apis-1). 3062 3063**System capability**: SystemCapability.Multimedia.Media.CodecBase 3064 3065**Since**: 12 3066 3067 3068### OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR 3069 3070``` 3071const char* OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR 3072``` 3073**Description** 3074 3075Pointer to the key that specifies whether the current frame is marked as an LTR frame. The value type is int32_t. **1** if marked, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. 3076 3077This key takes effect only after the number of LTR frames is configured. 3078 3079This key is optional and is used only for video encoding input rotation. The configuration takes effect immediately. 3080 3081For details, see [Temporally Scalable Video Coding](../../media/avcodec/video-encoding-temporal-scalability.md#available-apis-1). 3082 3083**System capability**: SystemCapability.Multimedia.Media.CodecBase 3084 3085**Since**: 12 3086 3087 3088### OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR 3089 3090``` 3091const char* OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR 3092``` 3093**Description** 3094 3095Pointer to the key that describes the POC number of the LTR frame referenced by the current frame. The value type is int32_t. 3096 3097This key is optional and is used only for video encoding input rotation. The configuration takes effect immediately. 3098 3099For details, see [Temporally Scalable Video Coding](../../media/avcodec/video-encoding-temporal-scalability.md#available-apis-1). 3100 3101**System capability**: SystemCapability.Multimedia.Media.CodecBase 3102 3103**Since**: 12 3104 3105 3106### OH_MD_KEY_VIDEO_ENCODER_QP_MAX 3107 3108``` 3109const char* OH_MD_KEY_VIDEO_ENCODER_QP_MAX 3110``` 3111 3112**Description** 3113 3114Pointer to the key that describes the maximum QP allowed by the video encoder. The value type is int32_t. 3115 3116This key is used in the configuration or parameter setting phase or takes effect immediately with each frame. 3117 3118**System capability**: SystemCapability.Multimedia.Media.CodecBase 3119 3120**Since**: 12 3121 3122 3123### OH_MD_KEY_VIDEO_ENCODER_QP_MIN 3124 3125``` 3126const char* OH_MD_KEY_VIDEO_ENCODER_QP_MIN 3127``` 3128 3129**Description** 3130 3131Pointer to the key that describes the minimum QP allowed by the video encoder. The value type is int32_t. 3132 3133This key is used in the configuration or parameter setting phase or takes effect immediately with each frame. 3134 3135**System capability**: SystemCapability.Multimedia.Media.CodecBase 3136 3137**Since**: 12 3138 3139 3140### OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE 3141 3142``` 3143const char* OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE 3144``` 3145 3146**Description** 3147 3148Pointer to the key that describes the average QP of video frames. The value type is int32_t. 3149 3150Pointer to the key that describes the average QP value of the current frame encoding block. It is output with [OH_AVBuffer](_core.md#oh_avbuffer) 3151 3152**System capability**: SystemCapability.Multimedia.Media.CodecBase 3153 3154**Since**: 12 3155 3156 3157### OH_MD_KEY_VIDEO_ENCODER_MSE 3158 3159``` 3160const char* OH_MD_KEY_VIDEO_ENCODER_MSE 3161``` 3162 3163**Description** 3164 3165Pointer to the key that describes the MSE of video frames. The value type is double. 3166 3167Pointer to the key that describes the average MSE value of the current frame encoding block. It is output with [OH_AVBuffer](_core.md#oh_avbuffer) 3168 3169**System capability**: SystemCapability.Multimedia.Media.CodecBase 3170 3171**Since**: 12 3172 3173 3174### OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE 3175 3176``` 3177const char* OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE 3178``` 3179 3180**Description** 3181 3182Pointer to the key that describes the reference mode in a temporal image group. The value type is int32_t. For details, see [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode). This key is valid only when temporal scalability is enabled. 3183 3184This key is optional and used only in the configuration phase of video encoding. 3185 3186**System capability**: SystemCapability.Multimedia.Media.CodecBase 3187 3188**Since**: 12 3189 3190 3191### OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE 3192 3193``` 3194const char* OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE 3195``` 3196 3197**Description** 3198 3199Pointer to the key that describes the size of a temporal image group. The value type is int32_t. This key is valid only when temporal scalability is enabled. 3200 3201This key is optional and used only in the configuration phase of video encoding. 3202 3203**System capability**: SystemCapability.Multimedia.Media.CodecBase 3204 3205**Since**: 12 3206 3207 3208### OH_MD_KEY_VIDEO_IS_HDR_VIVID 3209 3210``` 3211const char* OH_MD_KEY_VIDEO_IS_HDR_VIVID 3212``` 3213 3214**Description** 3215 3216Pointer to the key that specifies whether the video track in a media file is HDR Vivid. The value type is int32_t. This key is used for both multiplexing and demultiplexing. 3217 3218**1** means that the video track is an HDR Vivid video track; **0** otherwise. 3219 3220**System capability**: SystemCapability.Multimedia.Media.CodecBase 3221 3222**Since**: 11 3223 3224 3225### OH_MD_KEY_DECODING_TIMESTAMP 3226 3227``` 3228const char* OH_MD_KEY_DECODING_TIMESTAMP 3229``` 3230 3231**Description** 3232 3233Pointer to the key that describes the decoding timestamp corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t. 3234 3235**System capability**: SystemCapability.Multimedia.Media.CodecBase 3236 3237**Since**: 12 3238 3239 3240### OH_MD_KEY_BUFFER_DURATION 3241 3242``` 3243const char* OH_MD_KEY_BUFFER_DURATION 3244``` 3245 3246**Description** 3247 3248Pointer to the key that describes the duration corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t. 3249 3250**System capability**: SystemCapability.Multimedia.Media.CodecBase 3251 3252**Since**: 12 3253 3254 3255### OH_MD_KEY_START_TIME 3256 3257``` 3258const char* OH_MD_KEY_START_TIME 3259``` 3260 3261**Description** 3262 3263Pointer to the key that describes the start time of the first frame in a media file, measured in microseconds. The value type is int64_t. 3264 3265**System capability**: SystemCapability.Multimedia.Media.CodecBase 3266 3267**Since**: 12 3268 3269### OH_MD_KEY_TRACK_START_TIME 3270 3271``` 3272const char* OH_MD_KEY_TRACK_START_TIME 3273``` 3274 3275**Description** 3276 3277Pointer to the key that describes the start time of the track, measured in microseconds. The value type is int64_t. 3278 3279**System capability**: SystemCapability.Multimedia.Media.CodecBase 3280 3281**Since**: 12 3282 3283 3284### OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE 3285 3286``` 3287const char* OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE 3288``` 3289 3290**Description** 3291 3292Pointer to the key that describes the output color space of the video decoder. The value type is int32_t. 3293 3294The supported value is **OH_COLORSPACE_BT709_LIMIT**. For details, see [OH_NativeBuffer_ColorSpace](../apis-arkgraphics2d/capi-buffer-common-h.md#oh_nativebuffer_colorspace). 3295 3296It is used when [OH_VideoDecoder_Configure](_video_decoder.md#oh_videodecoder_configure) is called. 3297 3298Before calling **OH_VideoDecoder_Start**, you must call **OH_VideoDecoder_Prepare**. 3299 3300If Color Space Conversion (CSC) is supported and this key is configured, the video decoder automatically transcodes the HDR Vivid video to the specified color space. 3301 3302If CSC function not supported, the error code [AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION](_core.md#oh_averrcode-1) is returned when [OH_VideoDecoder_Configure](_video_decoder.md#oh_videodecoder_configure) is called. 3303 3304If the input video is not an HDR Vivid video, the callback function [OH_AVCodecOnError](#oh_avcodeconerror) is invoked to report the error code [AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION](_core.md#oh_averrcode-1). 3305 3306**System capability**: SystemCapability.Multimedia.Media.CodecBase 3307 3308**Since**: 12 3309 3310 3311### OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR 3312 3313``` 3314const char* OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR 3315``` 3316**Description** 3317 3318Pointer to the key that specifies whether the frame corresponding to the stream output from the current OH_AVBuffer is marked as an LTR frame. The value type is int32_t. **1** if marked, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. 3319 3320This key is optional and is used only for video encoding output rotation. 3321 3322It indicates the attribute of a frame. 3323 3324**System capability**: SystemCapability.Multimedia.Media.CodecBase 3325 3326**Since**: 12 3327 3328 3329### OH_MD_KEY_VIDEO_PER_FRAME_POC 3330 3331``` 3332const char* OH_MD_KEY_VIDEO_PER_FRAME_POC 3333``` 3334**Description** 3335 3336Pointer to the key that describes the POC number of the frame. The value type is int32_t. 3337 3338This key is optional and is used only for video encoding output rotation. 3339 3340It indicates the attribute of a frame. 3341 3342**System capability**: SystemCapability.Multimedia.Media.CodecBase 3343 3344**Since**: 12 3345 3346 3347### OH_MD_KEY_VIDEO_PIC_HEIGHT 3348 3349``` 3350const char* OH_MD_KEY_VIDEO_PIC_HEIGHT 3351``` 3352 3353**Description** 3354 3355Pointer to the key that describes the height of the video frame. The value type is int32_t. 3356 3357When [OH_VideoDecoder_GetOutputDescription](_video_decoder.md#oh_videodecoder_getoutputdescription) is called during video decoding, the height can be parsed from the returned OH_AVFormat instance. 3358 3359When the decoded output stream<!--RP2--><!--RP2End--> changes, the height can be parsed from the OH_AVForamt instance returned by [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged). 3360 3361The width and height parsed from the OH_AVFormat instance are aligned, which are different from **OH_MD_KEY_WIDTH** and **OH_MD_KEY_HEIGHT** set by calling **Configure**. 3362 3363For details about the image arrangement and usage examples of **width**, **height**, **wStride**, and **hStride**, see step 8 in buffer mode in [Video Encoding](../../media/avcodec/video-encoding.md#buffer-mode) or step 11 in buffer mode in [Video Decoding](../../media/avcodec/video-decoding.md#buffer-mode). 3364 3365**System capability**: SystemCapability.Multimedia.Media.CodecBase 3366 3367**Since**: 12 3368 3369 3370### OH_MD_KEY_VIDEO_PIC_WIDTH 3371 3372``` 3373const char* OH_MD_KEY_VIDEO_PIC_WIDTH 3374``` 3375 3376**Description** 3377 3378Pointer to the key that describes the width of the video frame. The value type is int32_t. 3379 3380When [OH_VideoDecoder_GetOutputDescription](_video_decoder.md#oh_videodecoder_getoutputdescription) is called during video decoding, the width can be parsed from the returned OH_AVFormat instance. 3381 3382When the decoded output stream<!--RP2--><!--RP2End--> changes, the width can be parsed from the OH_AVForamt instance returned by [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged). 3383 3384The width and height parsed from the OH_AVFormat instance are aligned, which are different from **OH_MD_KEY_WIDTH** and **OH_MD_KEY_HEIGHT** set by calling **Configure**. 3385 3386For details about the image arrangement and usage examples of **width**, **height**, **wStride**, and **hStride**, see step 8 in buffer mode in [Video Encoding](../../media/avcodec/video-encoding.md#buffer-mode) or step 11 in buffer mode in [Video Decoding](../../media/avcodec/video-decoding.md#buffer-mode). 3387 3388**System capability**: SystemCapability.Multimedia.Media.CodecBase 3389 3390**Since**: 12 3391 3392 3393### OH_MD_KEY_VIDEO_SLICE_HEIGHT 3394 3395``` 3396const char* OH_MD_KEY_VIDEO_SLICE_HEIGHT 3397``` 3398**Description** 3399 3400Pointer to the key that describes the height of the video frame. The value type is int32_t. 3401 3402The height is the number of rows that must be offset from the top of the Y plane to the top of the U plane. Essentially, the offset of the U plane is sliceHeight \* stride. 3403 3404The height of the U/V plane can be calculated based on the color format, but it is usually not defined and depends on the device and version. 3405 3406For details, see step 3 in buffer mode in [Video Encoding](../../media/avcodec/video-encoding.md#buffer-mode). 3407 3408For details about the image arrangement and usage examples of **width**, **height**, **wStride**, and **hStride**, see step 8 in buffer mode in [Video Encoding](../../media/avcodec/video-encoding.md#buffer-mode) or step 11 in buffer mode in [Video Decoding](../../media/avcodec/video-decoding.md#buffer-mode). 3409 3410**System capability**: SystemCapability.Multimedia.Media.CodecBase 3411 3412**Since**: 12 3413 3414 3415### OH_MD_KEY_VIDEO_STRIDE 3416 3417``` 3418const char* OH_MD_KEY_VIDEO_STRIDE 3419``` 3420**Description** 3421 3422Pointer to the key that describes the stride of the video frame. The value type is int32_t. 3423 3424The stride is the difference between the index of the pixel and the index of the pixel right below. 3425 3426For the YUV420 format, the stride corresponds to the Y plane. The stride of the U/V plane can be calculated based on the color format, but it is usually not defined and depends on the device and version. 3427 3428For details, see step 3 in buffer mode in [Video Encoding](../../media/avcodec/video-encoding.md#buffer-mode). 3429 3430For details about the image arrangement and usage examples of **width**, **height**, **wStride**, and **hStride**, see step 8 in buffer mode in [Video Encoding](../../media/avcodec/video-encoding.md#buffer-mode) or step 11 in buffer mode in [Video Decoding](../../media/avcodec/video-decoding.md#buffer-mode). 3431 3432**System capability**: SystemCapability.Multimedia.Media.CodecBase 3433 3434**Since**: 12 3435 3436 3437### OH_MD_KEY_WIDTH 3438 3439``` 3440const char* OH_MD_KEY_WIDTH 3441``` 3442 3443**Description** 3444 3445Pointer to the key that describes the video width. The value type is int32_t. 3446 3447This key is used to set the display width of a video frame when **Configure** is called during video encoding and decoding. 3448 3449You can call [OH_AVCapability_GetVideoWidthRange](_a_v_capability.md#oh_avcapability_getvideowidthrange) to obtain the value range. 3450 3451For details about the development guide, see step 5 in surface mode or step 4 in buffer mode in [Video Encoding](../../media/avcodec/video-encoding.md). 3452 3453**System capability**: SystemCapability.Multimedia.Media.CodecBase 3454 3455**Since**: 9 3456 3457 3458### OH_MD_MAX_INPUT_BUFFER_COUNT 3459 3460``` 3461const char* OH_MD_MAX_INPUT_BUFFER_COUNT 3462``` 3463 3464**Description** 3465 3466Pointer to the key that describes the maximum number of input buffers. The value type is int32_t. 3467 3468**System capability**: SystemCapability.Multimedia.Media.CodecBase 3469 3470**Since**: 10 3471 3472 3473### OH_MD_MAX_OUTPUT_BUFFER_COUNT 3474 3475``` 3476const char* OH_MD_MAX_OUTPUT_BUFFER_COUNT 3477``` 3478 3479**Description** 3480 3481Pointer to the key that describes the maximum number of output buffers. The value type is int32_t. 3482 3483**System capability**: SystemCapability.Multimedia.Media.CodecBase 3484 3485**Since**: 10 3486 3487 3488### OH_MD_KEY_VIDEO_SAR 3489 3490``` 3491const char* OH_MD_KEY_VIDEO_SAR 3492``` 3493 3494**Description** 3495 3496Pointer to the key that describes the aspect ratio of the sample. The value type is double. 3497 3498**System capability**: SystemCapability.Multimedia.Media.CodecBase 3499 3500**Since**: 12 3501 3502 3503### OH_MD_KEY_CREATION_TIME 3504 3505``` 3506const char* OH_MD_KEY_CREATION_TIME 3507``` 3508 3509**Description** 3510 3511Pointer to the key that describes the media file creation time. The value type is string. The value must be in the UTC time format complying with ISO 8601. An example time format is 2024-12-28T00:00:00:000000Z. 3512 3513**System capability**: SystemCapability.Multimedia.Media.CodecBase 3514 3515**Since**: 14 3516 3517### OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR 3518 3519``` 3520const char* OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR 3521``` 3522 3523**Description** 3524 3525Pointer to the key that specifies whether the decoder enables the video variable frame rate feature. The value type is int32_t. **1** if enabled, **0** otherwise. 3526 3527**System capability**: SystemCapability.Multimedia.Media.CodecBase 3528 3529**Since**: 15 3530 3531### OH_MD_KEY_SQR_FACTOR 3532 3533``` 3534const char* OH_MD_KEY_SQR_FACTOR 3535``` 3536 3537**Description** 3538 3539Pointer to the key that describes the quality parameter in SQR mode. The value range is [0, 51] (same as the QP value in encoding). A smaller value indicates a higher output bit rate and better quality. 3540 3541It is used in the configuration or parameter setting phase. 3542 3543**System capability**: SystemCapability.Multimedia.Media.CodecBase 3544 3545**Since**: 20 3546 3547### OH_MD_KEY_MAX_BITRATE 3548 3549``` 3550const char* OH_MD_KEY_MAX_BITRATE 3551``` 3552 3553**Description** 3554 3555Pointer to the key that describes the maximum bit rate in SQR mode. The value range can be obtained by calling [OH_AVCapability_GetEncoderBitrateRange](_a_v_capability.md#oh_avcapability_getencoderbitraterange) and is the same as that of [OH_MD_KEY_BITRATE](#oh_md_key_bitrate). The unit is bit/s. 3556 3557It is used in the configuration or parameter setting phase. 3558 3559**System capability**: SystemCapability.Multimedia.Media.CodecBase 3560 3561**Since**: 20 3562 3563### OH_MD_KEY_VIDEO_ENCODER_ROI_PARAMS 3564 3565``` 3566const char* OH_MD_KEY_VIDEO_ENCODER_ROI_PARAMS 3567``` 3568 3569**Description** 3570 3571Pointer to the key that describes the enabled status of ROI encoding in video encoding, with ROI parameters delivered. The parameters take effect immediately with the frame. 3572 3573The value must be in the format of "Top1,Left1-Bottom1,Right1=Offset1;Top2,Left2-Bottom2,Right2=Offset2;", where multiple ROI parameters are separated by semicolons (;). 3574 3575**Top**, **Left**, **Bottom**, and **Right** specify the upper, left, bottom, and right boundaries of an ROI area, respectively. **Offset** specifies deltaQP. **(=Offset)** can be omitted. If it is omitted, the default value (**–3**) is used. 3576 3577**System capability**: SystemCapability.Multimedia.Media.CodecBase 3578 3579**Since**: 20 3580 3581### OH_MD_KEY_ENABLE_MOOV_FRONT 3582 3583``` 3584const char* OH_MD_KEY_ENABLE_MOOV_FRONT 3585``` 3586 3587**Description** 3588 3589Pointer to the key that specifies whether moov metadata is placed at the front of an MP4 file for multiplexing. **1** if placed at the front, **0** otherwise. 3590 3591**System capability**: SystemCapability.Multimedia.Media.CodecBase 3592 3593**Since**: 20 3594 3595### OH_MD_KEY_VIDEO_ENCODER_ENABLE_PTS_BASED_RATECONTROL 3596 3597``` 3598const char* OH_MD_KEY_VIDEO_ENCODER_ENABLE_PTS_BASED_RATECONTROL 3599``` 3600 3601**Description** 3602 3603Pointer to the key that describes the enabled status of the PTS-based bit rate control mode. The value type is int32_t. **1** if enabled, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. 3604 3605This key is optional and is used only for video encoding. 3606 3607If this feature is enabled, each video frame must contain PTS information and be sent to the encoder. In surface mode, the PTS is set by calling [OH_NativeWindow_NativeWindowHandleOpt](../apis-arkgraphics2d/capi-external-window-h.md#oh_nativewindow_nativewindowhandleopt), in units of nanosecond (ns). In buffer mode, the PTS is set by calling [OH_AVBuffer_SetBufferAttr](_core.md#oh_avbuffer_setbufferattr), in units of microsecond (us). 3608 3609It is used in the configuration phase. 3610 3611**System capability**: SystemCapability.Multimedia.Media.CodecBase 3612 3613**Since**: 20 3614 3615### OH_MD_KEY_VIDEO_ENCODER_ENABLE_B_FRAME 3616 3617``` 3618const char* OH_MD_KEY_VIDEO_ENCODER_ENABLE_B_FRAME 3619``` 3620 3621**Description** 3622 3623Pointer to the key that describes the enabled status of B-frame encoding. The value type is int32_t. **1** if enabled, **0** otherwise. 3624 3625This key is optional and used only for video encoding. The default value is **0**. 3626 3627Before using this key, you can use the API [OH_AVCapability_isFeatureSupported](_a_v_capability.md#oh_avcapability_isfeaturesupported) and the enum [VIDEO_ENCODER_B_FRAME](_a_v_capability.md#oh_avcapabilityfeature-1) to check whether the platform supports this feature. 3628 3629This key is optional and used only in the configuration phase of video encoding. 3630 3631**System capability**: SystemCapability.Multimedia.Media.CodecBase 3632 3633**Since**: 20 3634 3635### OH_MD_KEY_VIDEO_ENCODER_MAX_B_FRAMES 3636 3637``` 3638const char* OH_MD_KEY_VIDEO_ENCODER_MAX_B_FRAMES 3639``` 3640 3641**Description** 3642 3643Pointer to the key that describes the maximum number of B-frames supported by B-frame encoding in video encoding. The value type is int32_t. 3644 3645Before using this key, you can use the API [OH_AVCapability_GetFeatureProperties](_a_v_capability.md#oh_avcapability_getfeatureproperties) and the enum [VIDEO_ENCODER_B_FRAME](_a_v_capability.md#oh_avcapabilityfeature-1) to check whether the platform supports B-frame encoding. 3646 3647Use the API [OH_AVCapability_GetFeatureProperties](_a_v_capability.md#oh_avcapability_getfeatureproperties) and the enum [VIDEO_ENCODER_B_FRAME](_a_v_capability.md#oh_avcapabilityfeature-1) to obtain the handle to [OH_AVFormat](_core.md#oh_avformat). 3648 3649Use the API [OH_AVFormat_GetIntValue](_core.md#oh_avformat_getintvalue) to query the number of supported B-frames. 3650 3651This key is optional and used only in the configuration phase of video encoding. 3652 3653For details, see [B-frame Video Encoding](../../media/avcodec/video-encoding-b-frame.md#available-apis). 3654 3655 3656**System capability**: SystemCapability.Multimedia.Media.CodecBase 3657 3658**Since**: 20 3659 3660### OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER 3661 3662``` 3663const char* OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER 3664``` 3665 3666**Description** 3667 3668Pointer to the key that describes the duration (in milliseconds) for which the last frame will be resubmitted repeatedly, if no new frame is available after the previous frame is submitted to the encoder. The value type is int32_t. 3669 3670This key is used only in the configuration phase of video encoding in surface mode. 3671 3672| Value| Description| 3673| -------- | -------- | 3674| Less than or equal to 0| The request is intercepted in the configuration phase and **ERROR AV_ERR_INVALID_VAL** is returned. | 3675| Greater than 0| The last frame will be resubmitted repeatedly in the specified duration, measured in milliseconds.| 3676 3677**System capability**: SystemCapability.Multimedia.Media.CodecBase 3678 3679**Since**: 18 3680 3681 3682### OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT 3683 3684``` 3685const char* OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT 3686``` 3687 3688**Description** 3689 3690Pointer to the key that describes the maximum number of times the encoder can repeat encoding the previous frame when no new frame is available. The value type is int32_t. 3691 3692This key takes effect only when [OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER](#oh_md_key_video_encoder_repeat_previous_frame_after) is available and is used only in the configuration phase. 3693 3694| Value| Description| 3695| -------- | -------- | 3696| 0 | The request is intercepted in the configuration phase and **ERROR AV_ERR_INVALID_VAL** is returned. | 3697| Less than 0| If no new frame is available, the encoder repeatedly encodes the previous frame until the upper limit of the system is reached. | 3698| Greater than 0| If no new frame is available, the encoder repeatedly encodes the previous frame until the maximum number specified is reached.| 3699 3700**System capability**: SystemCapability.Multimedia.Media.CodecBase 3701 3702**Since**: 18 3703 3704### OH_MD_KEY_REFERENCE_TRACK_IDS 3705 3706``` 3707const char *OH_MD_KEY_REFERENCE_TRACK_IDS 3708``` 3709 3710**Description** 3711 3712Pointer to the key that describes the reference relationship between media file tracks. The value type is int32_t\*. 3713 3714**System capability**: SystemCapability.Multimedia.Media.CodecBase 3715 3716**Since**: 20 3717 3718### OH_MD_KEY_TRACK_REFERENCE_TYPE 3719 3720``` 3721const char *OH_MD_KEY_TRACK_REFERENCE_TYPE 3722``` 3723 3724**Description** 3725 3726Pointer to the key that describes the auxiliary track type of a media file. The value type is string. 3727 3728**System capability**: SystemCapability.Multimedia.Media.CodecBase 3729 3730**Since**: 20 3731 3732### OH_MD_KEY_TRACK_DESCRIPTION 3733 3734``` 3735const char *OH_MD_KEY_TRACK_DESCRIPTION 3736``` 3737 3738**Description** 3739 3740Pointer to the key that describes the auxiliary track description of a media file. The value type is string. 3741 3742**System capability**: SystemCapability.Multimedia.Media.CodecBase 3743 3744**Since**: 20 3745 3746 3747### OH_MD_KEY_VIDEO_DECODER_BLANK_FRAME_ON_SHUTDOWN 3748 3749``` 3750const char *OH_MD_KEY_VIDEO_DECODER_BLANK_FRAME_ON_SHUTDOWN 3751``` 3752 3753**Description** 3754 3755Pointer to the key that specifies whether to output blank frames when the video decoder is disabled. The value type is int32_t. **1** to output, **0** otherwise. The default value is **0**. If this parameter is set to a non-zero value, the value **1** is used. This key is optional and is used only for video decoding in surface mode. 3756 3757When this feature is enabled, the video decoder outputs blank frames (usually black) when it is stopped or released. This helps the display device smoothly transition to the no-signal state and prevents issues like display residuals or screen flickering that can happen if the decoder stops suddenly. 3758 3759**System capability**: SystemCapability.Multimedia.Media.CodecBase 3760 3761**Since**: 20 3762 3763<!--no_check-->