Audio
Transcodely supports three audio codecs: AAC, Opus, and MP3. Audio encoding is configured automatically based on your output container and codec selection, but you can control audio parameters through preset configuration.
Audio Codec Overview
| Property | AAC | Opus | MP3 |
|---|---|---|---|
| API value | aac | opus | mp3 |
| Standard | ISO/IEC 14496-3 | IETF RFC 6716 | ISO/IEC 11172-3 |
| Licensing | Patent pools | Royalty-free | Patents expired |
| Sweet spot bitrate | 128-192 kbps | 64-128 kbps | 192-256 kbps |
| Min bitrate | 32 kbps | 6 kbps | 32 kbps |
| Max bitrate | 512 kbps | 510 kbps | 320 kbps |
| Channels | Up to 7.1 | Up to 7.1 | Stereo only |
| Sample rates | 8-96 kHz | 8-48 kHz | 8-48 kHz |
| Latency | Low | Very low | Moderate |
AAC
AAC (Advanced Audio Coding) is the default audio codec for MP4 containers and the most widely supported lossy audio format. It delivers transparent quality at 128-192 kbps for stereo content.
When to use: MP4 outputs, maximum device compatibility, Apple ecosystem
Recommended bitrates:
| Use Case | Stereo | 5.1 Surround |
|---|---|---|
| Low bandwidth | 64 kbps | 192 kbps |
| Standard quality | 128 kbps | 384 kbps |
| High quality | 192 kbps | 448 kbps |
| Transparent | 256 kbps | 512 kbps |
AAC is automatically selected when your output container is MP4, MOV, or TS.
Container compatibility: MP4, MKV, MOV, TS, HLS, DASH
Opus
Opus is a royalty-free audio codec that provides the best quality-per-bit of any supported codec. It outperforms AAC at every bitrate, especially below 128 kbps.
When to use: WebM outputs, bandwidth-constrained delivery, highest quality at low bitrates
Recommended bitrates:
| Use Case | Stereo | 5.1 Surround |
|---|---|---|
| Voice/speech | 32 kbps | N/A |
| Low bandwidth | 48 kbps | 128 kbps |
| Standard quality | 96 kbps | 256 kbps |
| High quality | 128 kbps | 384 kbps |
| Transparent | 192 kbps | 448 kbps |
Opus is automatically selected when your output container is WebM.
Container compatibility: WebM, MKV
MP3
MP3 is supported for legacy compatibility. It provides acceptable quality at higher bitrates but is outperformed by both AAC and Opus. New projects should prefer AAC or Opus.
When to use: Legacy system compatibility, audio-only deliverables
Recommended bitrates:
| Use Case | Stereo |
|---|---|
| Voice/speech | 64 kbps |
| Standard quality | 192 kbps |
| High quality | 256 kbps |
| Maximum | 320 kbps |
MP3 is limited to stereo (2 channels). Surround sound content is downmixed to stereo when MP3 is used.
Container compatibility: MP4, MKV, MOV, TS
Audio Behavior
Transcodely automatically handles audio encoding based on your output configuration:
| Scenario | Behavior |
|---|---|
| MP4 output | Audio encoded as AAC at 128 kbps stereo |
| WebM output | Audio encoded as Opus at 128 kbps stereo |
| MKV output | Audio codec matches the container default (AAC) |
| No audio in input | Output has no audio track |
| Multi-channel input | Preserved if codec supports it, otherwise downmixed |
Multi-Audio Tracks
For HLS and DASH streaming outputs, you can specify multiple audio tracks with different languages:
{
"type": "hls",
"video": [
{"codec": "h264", "resolution": "1080p", "quality": "standard"}
],
"audio": [
{"language": "eng", "label": "English", "is_default": true},
{"language": "spa", "label": "Spanish", "source_track": 1},
{"language": "jpn", "label": "Japanese", "source_track": 2}
]
}Each audio track configuration supports:
| Field | Required | Description |
|---|---|---|
language | Yes | ISO 639-2 three-letter code (e.g., eng, spa, jpn) |
label | No | Human-readable name shown in player UI |
source_track | No | 0-based index of the audio track in the input file |
is_default | No | Whether this is the default audio track |
Multi-audio tracks are only available for streaming output types (hls, dash, adaptive). File-based outputs (MP4, WebM, etc.) include only the primary audio track.
Sample Rates
Common sample rates and their use cases:
| Sample Rate | Use Case |
|---|---|
| 8,000 Hz | Telephone-quality voice |
| 16,000 Hz | Wideband voice (VoIP) |
| 22,050 Hz | AM radio quality |
| 44,100 Hz | CD quality (standard) |
| 48,000 Hz | Professional audio, video standard (default) |
| 96,000 Hz | High-resolution audio |
Transcodely preserves the input sample rate by default. If the input sample rate is higher than the codec supports, it is downsampled automatically.