Comments (4)
How did opusenc determine the
R128_TRACK_GAIN
value?
See the metadata_callback()
function on lines 179 to 193.
From the RFC, decoders should add the header's output gain to R128_TRACK_GAIN
or R128_ALBUM_GAIN
to compute the final gain for the respective loudness normalization mode. For historical reasons, album gain is placed on the header's output gain field, and the difference between track gain and album gain is placed on the R128_TRACK_GAIN
tag. This is so because listeners are generally more satisfied using album gain, an assumption that often frees a decoder from the complexity of having to support both loudness normalization modes. As a note, this is also how foobar2000 works by default.
from opus-tools.
Hi, thanks for the report.
Opus files use the EBU R128 track normalization instead of ReplayGain, so encoders are supposed to convert the track gain to the built-in lossless gain in the codec header, convert album gain tag and drop the others. The worry was that if the ReplayGain tags were propagated, players might get confused and try to apply the adjustment twice.
So some of that is as intended, although stripping the "album gain" and not "track gain" sounds wrong. Do the resulting files play with the correct levels in your player?
from opus-tools.
- Understood about the
*_PEAK
tags, it's expected that they are dropped. - My sample input FLAC file has a
REPLAYGAIN_TRACK_GAIN
of -8.58 dB, the transcoded Opus file has aR128_TRACK_GAIN
of 123. I haven't done the math to check the value, but I assume it's right. foobar2000 displays "RG -8.58 dB" for both files. - So the remaining issue is about not having a
R128_ALBUM_GAIN
in the output file.
How did opusenc determine the R128_TRACK_GAIN
value?
- Did it convert it from the FLAC metadata?
- … or did it calculate it from the output Opus data?
It seems that the former is what opusenc does (because if I transcode a file without RG tags, the output has no R128_TRACK_GAIN
). So, opusenc should as well convert the REPLAYGAIN_ALBUM_GAIN
to R128_ALBUM_GAIN
.
The latter would be the proper way to get the exact value (as the codec is lossy), though in doing so, it would be normal to not have a R128_ALBUM_GAIN
, considering the tool can only take one input file at once.
from opus-tools.
See in the implementation of the metadata_callback()
function:
- Starting from line 144: Both
REPLAYGAIN_TRACK_GAIN
andREPLAYGAIN_ALBUM_GAIN
are looked for, and their values are memorised. - Starting from line 179: However, only the track gain is converted to a R128 metadata tag.
Refs commit 892fd92
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.