10 ms·
I used youtube-dl as my primary way to consume YouTube content (mostly lectures and podcasts) for a year when I had very limited internet access. youtube-dl -f
by andai 5y ago
I used youtube-dl as my primary way to consume YouTube content (mostly lectures and podcasts) for a year when I had very limited internet access.
youtube-dl -f bestaudio [url]
then convert to 12kbps Opus with
ffmpeg -i [file] -b:a 12K [file].opus
I could even do this from my phone over SSH but eventually made a simple web frontend for it. I haven't opened it to the public though, because of, well, news stories like this one.
- Narishma 5y agoI still do because Firefox doesn't support hardware video decoding on Linux in any of my machines. Though I use mpv, which then uses youtube-dl in the background.
- Hamuko 5y agoIsn't YouTube bestaudio already Opus?
- jerf 5y agoOften yes, but it'll be much higher quality than 12Kb/s. But 12Kb/s is plenty for human speech to be comprehensible, though you'll generally notice the quality loss. Plus, I haven't studied this but I don't think they reencode all old content. New videos seems consistent but older videos can have varying things available. Using bestaudio & ffmpeg will definitely get you a consistent result. I can't promise hard-coded -f options for specific formats will be reliable.
- Dylan16807 5y agoAlso, Opus is actually two codecs. You'll only see CELT, the general purpose codec, from about 32kbps and up. But at super low bitrates it uses SILK, a speech codec. At 12kbps you'd very probably see the hybrid mode, where SILK does the bulk of the work but CELT handles frequencies above 8kHz. So youtube is already Opus, but it's not already SILK.
- andai 5y agoYeah, my main intention was to save bandwidth, so I used just about the lowest possible bitrate and the best codec to match :)
- dylan604 5y agois it still considered downloading if you sent the output of youtube-dl to stdout rather than to a file, then have ffmpeg read from stdin?
- autoexec 5y agoI still do this. I never watch youtube videos on youtube anymore. It's a better experience. VLC is a better player, there are no ads, there are no comments, there are no recommended videos trying to bait me, and I don't even have to enable javascript for google's domains.
- Siira 5y agoFYI, mpv can open youtube links directly (using youtube-dl under the hood, I think).