[opus] Antw: Re: Possible bug in Opus 1.3 (opus-tools-0.2-opus-1.3)?

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Fri Nov 2 21:00:47 UTC 2018


Excuse the delay, but I had to deal with a corrupted NTFS file system that ate many important files on an USB stick...

The FLAC version of the original is almost 6MB and it can be downloaded slowly from this time-limited link:

On the meaning of a logarithmic sweep: If you use foobar2000 and the "Spectrum" you can see the bar move (once it reached 50Hz,
 a change request for displaying lower frequencies had been denied):
It should move linearly on foobar's logarithmic scale (as indicated in the file's comment).
Actually I don't know the exact definition of logarithmic in Audacity, but it seems it met my needs (using linear sweep is somewhat ridiculous for the ears).

On 48kHz on Opus: I'm unsure. I thought Opus can't handle 96kHz and it downsamples automatically.

Why using 96kHz in the original: AFAIK Vorbis and Opus both use frequency components to encode the file.
 With higher sampling frequencies in the original, I was expecting to reduce the aliasing effects for higher frequencies.

On the low frequencies: It's more or less for fun, but I knew one classic record where you could hear the nearby underground pass by.
 Quite low frequencies, too (a slight earth quake if you want to call it so). ;-)

On the two opus files: I just ran the encoder twice to make sure I did not make a mistake...


>>> Jan Stary <hans at stare.cz> 01.11.18 9.06 Uhr >>>
(Please wrap your lines.)

On Oct 26 01:38:34, Ulrich.Windl at rz.uni-regensburg.de wrote:
> Playing with Opus 1.3 I converted a tone sweep with a sample rate of 96kHz (just for fun). Before I had converted that from WAV to FLAC, and to Vorbis without problems.

Can you please post the original wav?

I am not sure what Audacity means by a logarithmisch sweep.
Is that a fixed number of Hertz per second (SoX calls that linear)?
Or a fixed number of semitones per second (SoX calls that exponantional)?

(The ogg comment says 5s=10Hz, 10s=20Hz, 15s=39Hz, 20s=78Hz, 25s=156Hz,
30s=312Hz, 35s=625Hz, 40s=1.25kHz, 45s=2.5kHz, 50s=5kHz, 55s=10kHz, 60s=20kHz
so it seems the frequency rises logarithmically.)

$ sox -c 1 -r 96k -b 16 -n /tmp/sweep.wav synth 60 sin create 1-20 gain -3

> With Opus I noticed that the file size for 48kHz and 48 kbps
> compared to 96kHz Vorbis at 31kbps is about double the size

Your opusenc line says "--bitrate 56 --vbr",
so where does the 48 come from?


$ flac sweep.wav
$ oggenc sweep.wav
$ opusenc sweep.wav sweep.opus
$ ls -l sweep.*
-rw-r--r--  1 hans  wheel   2635692 Nov  1 08:49 sweep.flac
-rw-r--r--  1 hans  wheel    215185 Nov  1 08:49 sweep.ogg 
-rw-r--r--  1 hans  wheel    660815 Nov  1 08:49 sweep.opus
-rw-r--r--  1 hans  wheel  11520044 Nov  1 08:49 sweep.wav

So for me it is actualy about three times the size of an ogg
(and about 6% the size of the original wav).

I am not sure why you are using 96kHz in the original,
but doing the same with a 48kHz original wav results in

-rw-r--r--  1 hans  wheel  1468106 Nov  1 08:51 sweep.flac
-rw-r--r--  1 hans  wheel   113787 Nov  1 08:51 sweep.ogg
-rw-r--r--  1 hans  wheel   611386 Nov  1 08:51 sweep.opus
-rw-r--r--  1 hans  wheel  5760044 Nov  1 08:51 sweep.wav

All of them approximately halve, but opus does not.
Is that expected?

> and it sounds even worse (than Vorbis)
> (there is a lot of noise in the lower frequencies
> when a low frequency tone is being played).

Are you sure your speakers/headphones can even reproduce
such low frequencies accurately? I doubt it.

> Here is what opusinfo outputs:
> Processing file "D:\Work\Ulrich\Musik\Vega\Opus\Audacity\Test-Sweeps\02 Sweep (0
> -20kHz at 96kHz) log.opus"...
> New logical stream (#1, serial: 000028fd): type opus
> Encoded with libopus 1.3, libopusenc 0.2.1
> User comments section follows...
>         ENCODER=opusenc from opus-tools 0.2-3-gf5f571b
>         ENCODER_OPTIONS=--bitrate 56 --vbr --comp 5
>         ALBUM=Test-Sweeps
>         ARTIST=Audacity
>         COMMENT=60s logarithmic sweep (0-20kHz): 5s=10Hz, 10s=20Hz, 15s=39Hz, 20
> s=78Hz, 25s=156Hz, 30s=312Hz, 35s=625Hz, 40s=1.25kHz, 45s=2.5kHz, 50s=5kHz, 55s=
> 10kHz, 60s=20kHz
>         COMMENTS=60s logarithmisch
>         DATE=2016
>         TITLE=Sweep (0-20kHz at 96kHz) log
>         TRACKNUMBER=2
> Opus stream 1:
>         Pre-skip: 312
>         Playback gain: 0 dB
>         Channels: 1
>         Original sample rate: 96000 Hz
>         Packet duration:   20.0ms (max),   20.0ms (avg),   20.0ms (min)
>         Page duration:   1000.0ms (max),  983.9ms (avg),   20.0ms (min)
>         Total data length: 637535 bytes (overhead: 1.07%)
>         Playback length: 1m:00.000s
>         Average bitrate: 85 kbit/s, w/o overhead: 84.09 kbit/s
> Logical stream 1 ended
> Here is the encoding output for a manual test:

Wait, so there are two opus files at play here?
How exactly did you create each? Is this the 48kHz one?
Post the files you are describing.


> C:\Program Files (x86)\foobar2000\codecs\opus-tools-0.2-opus-1.3>opusenc.exe --b
> itrate 56 --vbr "D:\Work\Ulrich\Musik\Vega\FLAC\Audacity\Test-Sweeps\02 Sweep (0
> -20kHz at 96kHz) log.flac" "D:\Work\Ulrich\Musik\test.opus"
> Encoding using libopus 1.3 (audio)
> -----------------------------------------------------
>    Input: 96 kHz, 1 channel
>   Output: 1 channel (1 uncoupled)
>           20ms packets, 56 kbit/s VBR
>  Preskip: 312
> Encoding complete
> -----------------------------------------------------
>        Encoded: 1 minute and 0.02 seconds
>        Runtime: 1 second
>                 (60.02x realtime)
>          Wrote: 749625 bytes, 3001 packets, 63 pages
>        Bitrate: 98.9456 kbit/s (without overhead)
>  Instant rates: 44 to 122.4 kbit/s
>                 (110 to 306 bytes per packet)
>       Overhead: 0.972% (container+metadata)

opus mailing list
opus at xiph.org

More information about the opus mailing list