-
Notifications
You must be signed in to change notification settings - Fork 519
Download:Audio
YouTube now provides audio formats, but they are using an uncommon codec. The custom filename is not supported for the audio format as therefore it will only download the audio file as "videoplayback" (YouTube Center is not able to at the moment to change this).
You're able to convert the Dash audio format to any format by using ffmpeg.
To convert the downloaded audio you will first have to take note about what bitrate (i.e. 128 kbps) audio you're downloading as this is important when you're converting the audio (if you don't want to loose audio quality).
Converting the downloaded audio with VBR is done by command line (you might be able to download a GUI though).
To be able to convert it you need to find the quality id for your audio bitrate. You can use the table to find the quality id.
Quality Id | Kbit/s | Bitrate Range (kbit/s) |
---|---|---|
0 | 245 | 220 - 260 |
1 | 225 | 190 - 250 |
2 | 190 | 170 - 210 |
3 | 175 | 150 - 195 |
4 | 165 | 140 - 185 |
5 | 130 | 120 - 150 |
6 | 115 | 100 - 130 |
7 | 100 | 80 - 120 |
8 | 85 | 70 - 105 |
9 | 65 | 45 - 85 |
Thereafter you just need to execute this in the command line, but you need to replace INPUT_FILE
with the downloaded audio, QUALITY_ID
with the quality id you chose depending on the bitrate, and OUTPUT_FILE
which needs to be replaced by how you want the file name of the new converted file to be. Also the extension on the output file needs to be a valid audio format like .mp3
or .m4a
.
ffmpeg -i INPUT_FILE -q:a QUALITY_ID -vn OUTPUT_FILE
After this ffmpeg will begin converting the audio.
Converting the downloaded audio is done by command line (you might be able to download a GUI though).
To be able to convert it you need to know your audio's bitrate, which was shown in the download menu. You then need to convert the bitrate from kbit/s to bit/s. This is done by adding three zeroes after the bitrate. So if you had a 192 kbit/s audio it would become 192000 bit/s.
Thereafter you just need to execute this in the command line, but you need to replace INPUT_FILE
with the downloaded audio, BITRATE
with the audio bitrate (only the number is allowed), and OUTPUT_FILE
which needs to be replaced by how you want the file name of the new converted file to be. Also the extension on the output file needs to be a valid audio format like .mp3
or .m4a
.
ffmpeg -i INPUT_FILE -ab BITRATE -vn OUTPUT_FILE
After this ffmpeg will begin converting the audio.
The audio file has the mime-type: "audio/mp4" and therefore should have the file extension: "m4a" or "mp4". You will therefore have to rename the files yourself after download.
The audio formats can have the following bitrates (quality of the audio): 49 Kbps, 128 Kbps and 256 Kbps.
The uncommon codec is Dash and some media players can't play this. For example VLC Player and Windows Media Player (probably needs the correct codec) can't play them. The audio codec is AAC and should be playable by most audio libraries.
If you want to be able to play these audio files. The media player should be able to understand the Dash codec, which MPC should be able to.
The media info of an 128 Kbps audio file:
General
Format : dash
Codec ID : dash
File size : 2.18 MiB
Duration : 2mn 24s
Overall bit rate mode : Constant
Overall bit rate : 127 Kbps
Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 2mn 24s
Bit rate mode : Constant
Bit rate : 126 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 2.16 MiB (99%)