Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip EBU R128 gain tags when using forced-RG transcoding #145

Merged
merged 1 commit into from Jun 20, 2021

Conversation

spijet
Copy link
Contributor

@spijet spijet commented Jun 20, 2021

Hello @sentriz, long time no see! :)

I was messing around with my encode profiles and found that in some cases (e.g. my music library) source files can have EBU R128 gain tags alongside ordinary ReplayGain tags. If we don't instruct ffmpeg to strip out these tags during RG-enabled transcoding, it can confuse some client apps into thinking that the track has ReplayGain tags and should be processed accordingly.

The main problem is that these R128 tags have a different scale than normal RG ones, and even when left with a value of 0 (zero) it can cause some clients to forcibly apply a whopping +5.0 dB gain to the track, causing clipping and occasional ear bleeding. :)

This PR fixes it by stripping these tags out. I double-checked the result (with mediainfo and Foobar2000) and now there are no rogue gain tags left anymore.

@sentriz sentriz merged commit 5444d40 into sentriz:master Jun 20, 2021
@sentriz
Copy link
Owner

sentriz commented Jun 20, 2021

hi again! thanks for the fix :) this makes sense to me. the next release (#141 ) will hopefully be coming after #63 is fixed

@spijet
Copy link
Contributor Author

spijet commented Jun 20, 2021

Wow, that was quick! :D

I'll add more PRs tomorrow — my local branch now has a bit more accurate (but tad slower) RG processing and some other quality-of-life additions, like properly specifying the MIME-type when transcoding (on cache hit AND cache miss) and ffmpeg now sending data to gonic in chunks of 16K bytes (this kiiinda helps with TTFB being small). As for now, it's 2 AM in my timezone. :)

@sentriz
Copy link
Owner

sentriz commented Jun 20, 2021

cool! looking forward to see what you have 👍 good night

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants