Skip to content

Add ReplayGain handling modes and automatic filenames to opusenc - #109

Open
JaoDoSantoCristo wants to merge 7 commits into
xiph:masterfrom
JaoDoSantoCristo:master
Open

Add ReplayGain handling modes and automatic filenames to opusenc#109
JaoDoSantoCristo wants to merge 7 commits into
xiph:masterfrom
JaoDoSantoCristo:master

Conversation

@JaoDoSantoCristo

@JaoDoSantoCristo JaoDoSantoCristo commented Aug 18, 2026

Copy link
Copy Markdown

Adds a --replaygain-mode argument that allows tweaking the handling of RG tags:

--replaygain-mode n Choose behavior of ReplayGain conversion
                       (0: ignore, 1: convert to R128, 2: copy, 3: track gain in header)

0 will completely scrap all ReplayGain tags;
1 will convert it to the EBU R128 standard, and yes it does account for the target difference;
2 just copies the values directly, not ideal but some players don't know what an "Arr One Twenty-Eight" is;
3 puts the track gain directly in the header and does some stuff to correct for the volume difference in players that DO support R128, since the decoder handles header gain this works on everything.

Also added automatic output filenames, to speed up conversion:

> opusenc --bitrate 96 "Gojira - Terra Inc..flac"
Output file: Gojira - Terra Inc..opus
Encoding using libopus unknown (audio)
-----------------------------------------------------
   Input: FLAC, 44.1 kHz, 2 channels, stereo
  Output: Opus, 2 channels (2 coupled), stereo
          20ms packets, 96 kbit/s VBR
 Preskip: 312

Encoding complete
-----------------------------------------------------
       Encoded: 2 minutes and 55.9 seconds
       Runtime: 13 seconds
                (13.53x realtime)
         Wrote: 2356617 bytes, 8795 packets, 179 pages
       Bitrate: 102.852 kbit/s (without overhead)
 Instant rates: 71.6 to 191.2 kbit/s
                (179 to 478 bytes per packet)
      Overhead: 4.04% (container+metadata)

> file "Gojira - Terra Inc..opus"
Gojira - Terra Inc..opus: Ogg data, Opus audio, version 0.1, stereo, 44100 Hz (Input Sample Rate)

It strips the path and replaces the extension, pretty simple. The option of typing it manually is still there if needed.

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.

1 participant