Hacker News new | ask | show | jobs
by Sevzinn 4086 days ago
Since so much of youtube consumption is audio-only, why not have a codec optimized to show nothing, or a still picture? Here at work we used to remote into a machine just to play youtube songs over the speakers. No video needed.
2 comments

Video codecs are good at compressing stills, so there's very little overhead in playing such a video when only the audio is desired.

That being said, YouTube does also encode audio-only versions of all their videos; they're not available from the web player though. You can use external software such as youtube-dl[1] to take advantage of it.

[1]: https://github.com/rg3/youtube-dl/ (using an invocation such as "youtube-dl -g -f bestaudio [url]" to retrieve the URL of an audio-only encode)

I don’t think that audio-only version comes from Youtube. I think youtube-dl downloads the whole video, then uses ffmpeg to extract and possibly re-encode its audio channel.
No, YouTube does have audio-only streams. You can use "youtube-dl -F [url]" to view the available formats and their codes.

They're meant to be paired with the video-only streams used for some resolutions (most notably 1080p). Even browser extensions such as YouTube Center can download the streams, and they certainly don't use ffmpeg.

(In fact, I do use ffmpeg to combine audio-only and video-only streams via youtube-dl, e.g. "youtube-dl -f 137+141 [url]" which takes 1080p video and 256k aac audio.)

Isn't using youtube-dl against youtube's TOS? What can be done legally?
I think they have done this for background playing on android mobile/google play. Perhaps a port is in order, or I do not fully understand the technology.