Hacker News new | ask | show | jobs
by djkoolaide 1047 days ago
I can answer about the audio.

YouTube (and most other streaming sites like Spotify etc) use something called ReplayGain. It's essentially a tag that specifies the calculated average loudness of the video/song/whatever (this number is calculated at upload time).

Upon playback, the official YT client knows to use that tag and adjust its volume level accordingly, but I'd imagine either the tag isn't getting downloaded, or perhaps MKV doesn't support ReplayGain tags natively.

5 comments

The loudness information is derived from the file in the first place, so a smart enough player can re-derive it and normalize audio on the fly. My player (mpv) does this by calling out to libav. It can handle both live audio and prerecorded audio, using different algorithms for each case. This functionality can be enabled with config flag `af="acompressor=ratio=4,loudnorm"`. I will admit that I copied these options from examples without really knowing what they do or how they do it, but they make things much more pleasant.

It's disgraceful that even major movie studios often do such a bad job with audio mixing that I indiscriminately run everything through a filter. This is not a problem with the files I'm using; I find the same thing in the theater. C'est la vie.

Thanks! I've always compared playing music on YT and playing lossless music in Rhythmbox on Linux and wondered why YT sounds better. Now discovered the ReplayGain toggle in Rhythmbox thanks to your comment.
Interesting. Indeed there is the line in the nerd stats overlay:

    Volume / Normalized 100% / 100% (content loudness -0.2dB)
You got me thinking now. I see there is some kinda ReplayGain postprocessor plugin for yt-dlp, however it's tied to some music downloading. I wish yt-dlp had a builtin option of some sort to process that tag.
That explains why YouTube on my TV is consistently 10 decibels louder than all the streaming services.
Interesting! TIL!