-
Notifications
You must be signed in to change notification settings - Fork 0
Formats and Quality
All formats are defined centrally in config.py. This page explains what the individual
entries mean and when each one makes sense.
| Selection | Extension | Codec | Bitrate | When it makes sense |
|---|---|---|---|---|
| MP3 (128 kbps) | .mp3 |
libmp3lame | 128k | Speech, podcasts, limited storage |
| MP3 (192 kbps) | .mp3 |
libmp3lame | 192k | Good compromise for mobile use |
| MP3 (256 kbps) | .mp3 |
libmp3lame | 256k | Default, fine for most purposes |
| MP3 (320 kbps) | .mp3 |
libmp3lame | 320k | Maximum for MP3, largest files |
| AAC (256 kbps) | .m4a |
aac | 256k | Apple devices, iTunes, better than MP3 at the same bitrate |
| OGG Vorbis (320 kbps) | .ogg |
libvorbis | 320k | Free format, good quality |
| WAV (Lossless) | .wav |
pcm_s16le | uncompressed | Further processing in editing and DAW software |
| Selection | Extension | Resolution | Note |
|---|---|---|---|
| MP4 (1080p) | .mp4 |
up to 1080p | Default, plays everywhere |
| MP4 (720p) | .mp4 |
up to 720p | Roughly half the size of 1080p |
| MP4 (480p) | .mp4 |
up to 480p | For small screens and tight storage |
| MP4 (360p) | .mp4 |
up to 360p | Smallest variant |
| MKV (Best) | .mkv |
highest available | Best tracks, including 1440p and 2160p |
| WebM (Best) | .webm |
highest available | VP9 and Opus, smaller at comparable quality |
The resolution values are upper bounds. If the requested step does not exist, the next best one is used automatically.
The Spotify downloader sources its audio from YouTube Music. That is a lossy source at roughly 256 kbps in AAC or Opus. Converting to FLAC would not recover the discarded information, it would only wrap a lossy signal losslessly. The result would be three to four times the size of the source and sound identical to a good MP3.
The comment in config.py puts it this way:
Source is YouTube Music (max ~256 kbps AAC/Opus), lossless formats are intentionally excluded
WAV is no quality gain for the same reason, but it is available because some programs require WAV as an input format.
- yt-dlp downloads with the selector
bestaudio/best, so the best available audio track. - The
FFmpegExtractAudiopostprocessor converts to the target codec. -
preferredqualitysets the target bitrate. For WAV the value is omitted, since PCM has no bitrate in the usual sense. - Optionally further postprocessors follow:
EmbedThumbnail,FFmpegEmbedSubtitle,SponsorBlockplusModifyChapters. - In the Spotify downloader, mutagen then writes the tags from the Spotify API.
Without FFmpeg, step 2 is skipped and the file stays in its source format.
yt-dlp downloads the video and audio tracks separately in the best matching versions and FFmpeg muxes them into the target container. No re-encoding takes place, the tracks are only repackaged. That is why a video download is usually much faster than an audio conversion.
converter.embed_metadata() picks the right tagger based on the file extension:
| Extension | Library | Tag system | Cover art |
|---|---|---|---|
.mp3 |
mutagen.id3 |
ID3v2.3 (TIT2, TPE1, TALB, TDRC) | APIC frame |
.flac |
mutagen.flac |
Vorbis comments | FLAC Picture |
.ogg |
mutagen.oggvorbis |
Vorbis comments | Base64 encoded metadata_block_picture
|
.m4a |
mutagen.mp4 |
iTunes atoms (©nam, ©ART, ©alb, ©day) |
covr |
.wav |
mutagen.wave |
ID3 inside the WAV container | APIC frame |
All cover art is embedded as JPEG. If embedding fails, the file is kept and the download still counts as successful, the error is silently ignored.
| Use case | Recommendation |
|---|---|
| Music for phone and car | MP3 (256 kbps) |
| Music library on a computer | MP3 (320 kbps) or AAC (256 kbps) |
| iPhone, iPad, Apple Music | AAC (256 kbps) |
| Podcasts and audiobooks | MP3 (128 kbps) |
| Editing, DAW, sampling | WAV (Lossless) |
| Video for archiving | MKV (Best) |
| Video for sharing | MP4 (1080p) |
| Video with tight storage | MP4 (480p) |
DeuMediaDownloader - for personal use only, with content you have the right to download. Respect the terms of service of Spotify, YouTube and TikTok as well as applicable copyright law.