Giter VIP home page Giter VIP logo

Comments (9)

rsmaior avatar rsmaior commented on August 16, 2024 1

@MisterZeus, as I know it ReplayGain is always used as a tag, it never clips the audio directly.

From my research, I could find that the wiki lists that as a To Do (https://wiki.xiph.org/OpusTodo):
"EBU R128/Replaygain (half done— needs a gain tool)"

There is already initial work on this repo https://github.com/kepstin/opusgain, maybe someone could pick it again?

from opus-tools.

rillian avatar rillian commented on August 16, 2024 1

The Opus RFC distinguishes between replaygain the feature, and REPLAY_GAIN the tag format. It says to implement the replaygain feature using tags with the EBU R128 normalization standard which is better defined and more professional.

The RFC says that tools shouldn't write tags using the REPLAY_GAIN normalization in opus files, the way loudness-scanner is reported to do in that thread.

What opusenc does instead is to convert REPLAY_GAIN tags in an input flac file to the R128 normalization scheme and write overall and R128_TRACK_GAIN annotations representing the same levels. So that's ok by the spec. What it's trying to avoid is just copying the REPLAY_GAIN tags without any conversion to the Opus standard.

Does that make sense?

from opus-tools.

rillian avatar rillian commented on August 16, 2024

NB opusenc will convert ReplayGain tags attached to input flac files.

from opus-tools.

xtemp09 avatar xtemp09 commented on August 16, 2024

If input file doesn't contain ReplayGain information in metadata, the encoder won't add it. =(

from opus-tools.

MisterZeus avatar MisterZeus commented on August 16, 2024

I would have thought ReplayGain should be independent of audio encoding, as it can be done either before encoding (on the input .flac or .wav file) or after it (on the output .opus).
I usually use foobar2000 to calc ReplayGain on the resulting Opus files.

Saying that, an optional(?) --add-replay-gain [album|track] switch on the encoder side would be a "nice bonus", conducive to Opus adoption on the net :-)

(or we could be super pro-active and make the encoder always add ReplayGain if it's missing, unless --no-replay-gain is used?)

from opus-tools.

rsmaior avatar rsmaior commented on August 16, 2024

While the official support is not here, I just found two nice third-party that can do the job (both using R128_TRACK_GAIN of course).

https://github.com/kepstin/regainer and https://github.com/desbma/r128gain (this one besides the name has nothing to do with the old R128GAIN that now is called BS1770GAIN).

from opus-tools.

rsmaior avatar rsmaior commented on August 16, 2024

@rillian you said "NB opusenc will convert ReplayGain tags attached to input flac files" but I read here that the Opus RFC itself recommends avoid this. Is that correct?

from opus-tools.

vlakoff avatar vlakoff commented on August 16, 2024

Refs the related #39 :)

from opus-tools.

bertogg avatar bertogg commented on August 16, 2024

Hello,

I'm not sure if this is the correct issue but I'm having a problem with how the Opus tools handle some ReplayGain tags.

Here are the steps to reproduce the problem:

  1. Start with a FLAC file. I'll use a public one for reference, the first track of this album: https://archive.org/details/nineinchnails_ghosts_I_IV
  2. Run loudgain -a -k -s e 01_Ghosts_I.flac (I'm using loudgain 0.6.8)
  3. This adds the following tags to the flac file:
REPLAYGAIN_ALBUM_GAIN=-2.97 dB
REPLAYGAIN_ALBUM_PEAK=0.956751
REPLAYGAIN_ALBUM_RANGE=6.32 dB
REPLAYGAIN_REFERENCE_LOUDNESS=-18.00 LUFS
REPLAYGAIN_TRACK_GAIN=-2.97 dB
REPLAYGAIN_TRACK_PEAK=0.956751
REPLAYGAIN_TRACK_RANGE=6.32 dB
  1. Check how the flac file can still be played and decoded normally.
  2. Run opusenc --bitrate 128 01_Ghosts_I.flac 01_Ghosts_I.opus
  3. Run opusinfo 01_Ghosts_I.opus and notice the 'Playback gain' value:
REPLAYGAIN_ALBUM_RANGE=6.32 dB
REPLAYGAIN_TRACK_RANGE=6.32 dB
R128_TRACK_GAIN=0
Playback gain: 99.0312 dB

The Opus file is unplayable now, very loud and distorted. If you use opusdec you'll get a completely clipped signal.

from opus-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.