Comments (9)
@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.
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.
NB opusenc will convert ReplayGain tags attached to input flac files.
from opus-tools.
If input file doesn't contain ReplayGain information in metadata, the encoder won't add it. =(
from opus-tools.
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.
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.
@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.
Refs the related #39 :)
from opus-tools.
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:
- 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
- Run
loudgain -a -k -s e 01_Ghosts_I.flac
(I'm using loudgain 0.6.8) - 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
- Check how the flac file can still be played and decoded normally.
- Run
opusenc --bitrate 128 01_Ghosts_I.flac 01_Ghosts_I.opus
- 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)
- generates wavs with a 46-byte I think Sox stat fails HOT 2
- Lyrics support
- How to modify metadata without re-encoding? HOT 5
- Enabling Ambisonic Encoding HOT 1
- `--hard-cbr` is not respected when frame size is set to 60 sometimes
- how to read the original data of opus file into python/numpy array? HOT 2
- [question] How does downsampling happen in decoding? HOT 1
- Opusenc from git fails to encode very short flac files on windows HOT 1
- opus_custom_decode() can't decode the custom stream while set sample rate less 24K HOT 3
- opusdec 0.2 is 6-7x slower than 0.1.10 HOT 2
- Force silence using built-in VAD during encoding HOT 2
- Add GitHub build workflow (`.github/workflows/build.yml`) for simpler user experimentation
- Parameter expect-loss is useless
- ` opusenc` extremely slow on `master+libopus1.4`. compared to `0.1.6+libopus1.0.2` HOT 2
- How to suppress `opusenc` progress bar, but still print the final stats?
- [bug] `opusenc` resampler is 3-4x slower in >= opus-tools-0.2 compared to opus-tools-0.1.10 (big degradation in encoding 8khz audio)
- Encoding multiple frames at once as oppose to per-frame encoding to save user<>kernel switches resulting from many `fread(...)` calls
- Option for opusenc to omit DTX/silence frames from output completely and provide options for controlling aggressivity of silence detection
- Produce RTP stream and dump it directly to a `.pcap` file
- new release?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opus-tools.