Using youtube-dl command-line tool under OS X. (It utilizes ffmpeg.)
Playing YouTube video in browser gives very acceptable audio (it's a song so only interested in the audio).
I download & transcode (several format options in yt-dl tool) but always get sizzling S's. Specified highest quality and tried these formats: opus, vorbis, m4a, aac. Similar results.
Alternately, tried using Soundflower to redirect browser's audio and record in Audacity with similar results.
What format is YT audio in and can I just download that and save with original quality?
Comments & observations welcome.
+ Reply to Thread
Results 1 to 13 of 13
My guess is there's nothing wrong with the audio you downloaded but you have too much gain on local playback, causing the blown out 'S'.
Not touching levels on playback, audio directly from YouTube (using browser) is excellent, whereas playback on transverted audio is same general volume (surely general volume would be noticeably higher if gain is too high) yet sizzling.
All EQ's are flat (ie, in Audacity).
EQ was enabled on VLC player. Turned off = audio is fine.
Don't know why Audacity is sizzling the same file in playback even though EQ is flat and output levels are nominal.
Last edited by davecc; 12th Mar 2016 at 13:38.
What commands are you using ? The default --audio-quality is 5 on a scale of 0 to 9. 0 is best. But this doesn't affect you unless you re-encode, which you shouldn't' be doing
Are you actually converting it? You said "I download & transcode" - You will lose quality if you convert it . It's better to download it and keep it that way
youtube-dl does not convert, youtube offers their videos in a number of different video and audio formats to serve all kinds of different browsers and connection speeds. So you can download (depending on the video) in mp3, aac, vorbis or opus sometimes with multiple bitrates available.
In some browsers you can right click and there is an option "stats for nerds" while the video is being served and you will see the details about which version you're actually getting. YT delivers different formats by default depending on the brower, device, OS version . But the version you're "hearing" / seeing in the browser isn't necessarily the highest quality version.
You can use youtube-dl -F URL to see the list of what is available, then specify exactly which one you want (note the capital F for the list) . To download it, use the lower case -f with the ID number
If it's available (older videos, which haven't been re-converted don't have it), these days usually the highest bitrate opus version is the best audio wise
format code extension resolution note
140 m4a audio only DASH audio 128k , m4a_dash container, mp4a.40.2@128k, 4.02MiB
160 mp4 256x144 144p 112k , avc1.4d400c, 15fps, video only, 3.38MiB
133 mp4 426x240 240p 247k , avc1.4d4015, 24fps, video only, 7.72MiB
134 mp4 640x360 360p 602k , avc1.4d401e, 24fps, video only, 10.39MiB
135 mp4 854x480 480p 1081k , avc1.4d401e, 24fps, video only, 20.78MiB
136 mp4 1280x720 720p 2000k , avc1.4d401f, 24fps, video only, 39.49MiB
137 mp4 1920x1080 1080p 4125k , avc1.640028, 24fps, video only, 88.01MiB
17 3gp 176x144 small , mp4v.20.3, mp4a.40.2@ 24k
36 3gp 320x180 small , mp4v.20.3, mp4a.40.2
5 flv 426x240 small , h263, mp3 @ 64k
43 webm 640x360 medium , vp8.0, vorbis@128k
18 mp4 640x360 medium , avc1.42001E, mp4a.40.2@ 96k
22 mp4 1280x720 hd720 , avc1.64001F, mp4a.40.2@192k (best)
- - -
Looks like the last one (hd720) has best audio (192K).
If I mouse-over (not click) on the YT video frame I see several choices. 720p is, apparently, the one I've been listening to and would like. So I should specify that file to youtube-dl.
How do I specify to youtube-dl a specific file I want? The URL remains the same no matter which resolution I choose.
Last edited by davecc; 12th Mar 2016 at 15:23.
Use -f followed by the number you see at the beginning of the line of the format you want to download. (140, 160, etc.)
youtube-dl -f 22 https://www.youtube.com/watch?v=QCrUGKwc8JA
Some audio formats can be directly downloaded without video, others only with interleaved video. So the former is much faster because the video typically makes up the largest amount of data. And you have to put in more work for extraction.
Downloaded "22" and sounds like what I want.
How do I extract the audio (don't want the video) without converting and possibly losing quality?
You can do it with ffmpeg
eg. copying the aac audio into a new mp4 container
ffmpeg -i input.mp4 -vn -c:a copy output.mp4
(Must be an older video that hasn't been updated yet; newer videos usually have more options, including opus. The older YT AAC encoder wasn't very good, but at 192kbps it should be ok)
Thanks poison, eh. Works a treat.