Hello,
I observed some strange behaviour of opusenc, when I use it to encode .flac files which contain replaygain data.
$metaflac --list audio.flac
...
comment[7]: replaygain_album_gain=-6.81 dB
comment[8]: replaygain_album_peak=1.000000
comment[9]: replaygain_track_gain=-6.37 dB
comment[10]: replaygain_track_peak=0.988525
...
Then, I encode that file with oggenc to .ogg and opusenc to .opus:
$oggenc audio.flac
$ogginfo audio.ogg
...
replaygain_album_gain=-6.81 dB
replaygain_album_peak=1.000000
replaygain_track_gain=-6.37 dB
replaygain_track_peak=0.988525
...
$opusenc audio.flac audio.opus
$opusinfo audio.opus
...
Opus stream 1:
Pre-skip: 356
Playback gain: -11.8086 dB
...
First strange observation is the very high gain value.
Second, even stranger observation: Even if I disable replaygain application in audio players, the opus file is much quiter than the ogg or flac file.
When I look at the waveform of the files in audacity (I also tried to manually decode the ogg and the opus file with oggdec/opusdec and load the wav files, same result), I see that the opus file indeed is much quiter (audacity does not apply replaygain, afaik. The first waveform is the opus file.):
[attachment=8176:audacity.png]
It seems like oggenc works correctly: It decodes the flac file (without applying replaygain), encodes to ogg and rewrites the replaygain tag fields. opusenc does not work as expected, I assume it applies replaygain when decoding the flac file and stores wrong replaygain values. This behaviour can be observed with any of my tagged flac files.
If I use the flag --discard-comments, then the loudness is correct, but I lose all tags.
By the way, that's the versions I'm using:
$ opusenc --version
opusenc opus-tools 0.1.9 (using libopus 1.1)
Copyright (C) 2008-2013 Xiph.Org Foundation
$ oggenc --version
oggenc from vorbis-tools 1.4.0
$metaflac --version
metaflac 1.3.1
$ flac --version
flac 1.3.1