# Media parameter definitions
## Audio
```json
"audio": {
"content_type": 2,
"sample_rate": 1,
"channel": 1,
"codec": 1,
"data_opt": 1,
"send_rate": 20
}
```
| Field | Type | Description |
| -------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `content_type` | int | The audio data can be configured as either raw data or RTP based, where the default setting is raw audio. For more information, see [MEDIA_CONTENT_TYPE](/docs/rtms/data-types/#media_content_type). For supported parameters by content type, see the [Audio parameters matrix](#audio-parameters-matrix). |
| `sample_rate` | int | The audio data sample rate supports multiple options including 8k, 16k, 32k, and 48k, where the default setting is 16k. For more information, see [AUDIO_SAMPLE_RATE](/docs/rtms/data-types/#audio_sample_rate). |
| `channel` | int | The audio data channel configuration allows either mono or stereo, where the default option is mono. For more information, see [AUDIO_CHANNEL](/docs/rtms/data-types/#audio_channel). |
| `codec` | int | The audio data codec supports various formats including Linear 16, G711, G722, and Opus, where the default setting is optimized at L16. For more information, see [MEDIA_PAYLOAD_TYPE](/docs/rtms/data-types/#media_payload_type). |
| `data_opt` | int | The audio data option provides support for mixed stream and active speakers, where the default setting is established as mixed stream. - `AUDIO_MIXED_STREAM` - All active speakers' audio is combined into a single mixed stream for output. - `AUDIO_MULTI_STREAMS` - Each active speaker's audio is output as separate streams, with support for up to 3 speakers per 20ms. For more information, see [MEDIA_DATA_OPTION](/docs/rtms/data-types/#media_data_option). |
| `send_rate` | int | The audio packets are transmitted according to the specified rate, which must be configured as a multiple of 20ms and cannot exceed 1000ms, where the default setting is 20ms. |
### Audio parameters matrix
| Content Type | Payload Type (Codec) | Sample Rate | Channel | Send Rate |
| ------------ | -------------------- | ----------------- | ---------------------- | ------------------------------------ |
| RTP | Opus | 48K | Mono (1) or Stereo (2) | 20ms |
| RTP | G711 (PCMA) | 8K | Mono (1) | 20ms |
| RTP | G722 | 16K | Mono (1) | 20ms |
| RAW | PCM (L16) | 8K, 16K, 32K, 48K | Mono (1) or Stereo (2) | 20ms – 1s (must be a multiple of 20) |
| RAW | Opus | 48K | Mono (1) or Stereo (2) | 20ms |
| RAW | G711 (PCMA) | 8K | Mono (1) | 20ms |
| RAW | G722 | 16K | Mono (1) | 20ms |
## Video
```json
"video": {
"content_type": 3,
"codec": 5,
"resolution": 2,
"fps": 5,
"data_opt": 3
}
```
| Field | Type | Description |
| -------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `content_type` | int | Currently, the only supported video data is `RAW_VIDEO`. For more information, see [MEDIA_CONTENT_TYPE](/docs/rtms/data-types/#media_content_type). |
| `codec` | int | The video `codec` supports `JPG`, `PNG`, and `H264`, where the default setting is `JPG`. For more information, see [MEDIA_PAYLOAD_TYPE](/docs/rtms/data-types/#media_payload_type). |
| `resolution` | int | The video `resolution` supports `SD`, `HD`, and `FHD`, where the default setting is `HD`. For more information, see [MEDIA_RESOLUTION](/docs/rtms/data-types/#media_resolution). |
| `fps` | int | The video `fps` supports values from `1` to `30`, where the default setting is `5`.- When `codec` is set to JPG or PNG, the `fps` is limited to a maximum of `5`. If the value is `0` or exceeds the allowed value of `5`, the RTMS server will automatically reset it to the default value of `5`.- When `codec` is set to H264, the `fps` can reach up to `30`. If the value is `0` or exceeds the maximum value of `30`, the RTMS server will automatically reset it to the default value of `5`. |
| `data_opt` | int | Video stream selection mode, default is `VIDEO_SINGLE_ACTIVE_STREAM`. - `VIDEO_SINGLE_ACTIVE_STREAM` - Active speaker's video only. - `VIDEO_SINGLE_INDIVIDUAL_STREAM` - Specific participant's video. For more information, see [MEDIA_DATA_OPTION](/docs/rtms/data-types/#media_data_option). |
## Screen share
```json
"deskshare": {
"content_type": RAW_VIDEO, // int, refer to MEDIA_CONTENT_TYPE enum definition
"codec": JPG, // int, refer to MEDIA_PAYLOAD_TYPE enum definition
"resolution": FHD, // int, refer to MEDIA_RESOLUTION enum definition
"fps": 1 // unsigned int
}
```
| Field | Type | Description |
| -------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `content_type` | int | Currently, the only support screen share data is `RAW_VIDEO`. For more information, see [MEDIA_CONTENT_TYPE](/docs/rtms/data-types/#media_content_type). |
| `codec` | int | The share data codec supports `JPG`, `PNG`, and `H264`, with `JPG` as the default setting. For more information, see [MEDIA_PAYLOAD_TYPE](/docs/rtms/data-types/#media_payload_type). |
| `resolution` | int | The share resolution offers `HD`, `FHD`, and `QHD`, with `FHD` as the default setting. For more information, see [MEDIA_RESOLUTION](/docs/rtms/data-types/#media_resolution). |
| `fps` | int | The share fps ranges from `1` to `30`, with `1` as the default setting.- When `codec` is set to `JPG` or `PNG`, the `fps` is limited to `1`. If the value is `0` or exceeds the maximum value of `1`, the RTMS server automatically resets it to the default value of `1`.- When `codec` is set to `H264`, the `fps` can reach up to `30`. If the value is 0 or exceeds the maximum value of `30`, the RTMS server automatically resets it to the default value of `1`. |
## Transcript
```json
"transcript": {
"content_type": 5,
"src_language": 9,
"enable_lid": true
}
```
| Field | Type | Description |
| -------------------------------------------------------------------------------------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `content_type` | int | Currently, the only supported transcript content type is `TEXT`. For more information, see [MEDIA_CONTENT_TYPE](/docs/rtms/data-types/#media_content_type). |
| `src_language` | int | Optional. The language of the transcript. If not specified, English will be the default language for the first 30 seconds of transcription. If specified, RTMS will transcribe the first 30 seconds of audio based on this language setting. For more information, see [RTMS_TRANSCRIPT_LANGUAGE](/docs/rtms/data-types/#rtms_transcript_language). |
| > After 30 seconds, the audio language will be automatically detected and override this parameter. |
| `enable_lid` | bool | Optional. Default is true and Language Identification is enabled. When set to false, Language Identification is disabled and transcription will rely solely on the `src_language` parameter. |
## Chat
```json
"chat": {
"content_type": 5
}
```
| Field | Type | Description |
| -------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `content_type` | int | Currently, the only supported chat content type is `TEXT`. For more information, see [MEDIA_CONTENT_TYPE](/docs/rtms/data-types/#media_content_type). |