Skip to main content

Overview

yt-dlp can extract audio from videos and convert it to your preferred format. This requires ffmpeg and ffprobe to be installed on your system.

Basic Audio Extraction

The simplest way to extract audio is using the -x flag:
By default, audio is extracted in the best available format. yt-dlp will choose the optimal format automatically.

Specify Audio Format

1

Choose your format

Select from supported formats: mp3, aac, flac, m4a, opus, vorbis, wav, alac, or best.
2

Extract with format conversion

3

Set quality level

Audio Format Examples

Advanced Audio Extraction

Extract without re-encoding

If the source already has the desired audio codec, avoid re-encoding to maintain quality:

Multiple audio quality rules

Convert based on source format:
This will:
  • Convert opus to mp3
  • Keep other formats in their best available quality

Audio-Only Downloads

Best audio quality

Extract Audio from Playlists

Download and extract audio from entire playlists:

Embed Metadata and Artwork

Metadata embedding requires either mutagen (Python package) or ffmpeg to be installed.
1

Basic metadata embedding

2

Custom metadata

3

Complete music file

Audio Processing Options

Normalize audio

Use ffmpeg postprocessor arguments:

Split by chapters

Extract each chapter as separate audio file:

Remove sponsor segments

Combine with SponsorBlock to remove ads/sponsors:

Preset Aliases for Audio

yt-dlp includes convenient presets:

Organizing Audio Downloads

Music library structure

By date

Python API Example

Extract audio programmatically:

Troubleshooting

ffmpeg not found

Audio extraction requires ffmpeg. Install it from ffmpeg.org or use your package manager.

Quality loss during conversion

Thumbnail not embedding

Next Steps

Post-Processing

Advanced post-processing options

Metadata Modification

Customize metadata in audio files

Playlists

Extract audio from entire playlists

Format Selection

Advanced audio format selection