[opus] Antw: Re: Possible bug in Opus 1.3

Jan Stary hans at stare.cz
Sun Nov 4 17:22:31 UTC 2018


(Please wrap your lines.)

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

On Nov 02 22:00:47, Ulrich.Windl at rz.uni-regensburg.de wrote:
> The FLAC version of the original is almost 6MB and it can be downloaded slowly from this time-limited link:
>  https://sbr5vjid0jgmce4q.myfritz.net:40262/nas/filelink.lua?id=0ba5a10529a6fe7b

Thanks.

I saved that as file.flac, uncompressed to file.wav,
and compressed that as ogg and opus as follows:

$ sox file.flac file.wav
$ opusenc file.wav file.opus
$ oggenc file.wav

$ soxi file.*
Input File     : 'file.flac'
Channels       : 1
Sample Rate    : 96000
Precision      : 24-bit
Duration       : 00:01:00.00 = 5760000 samples ~ 4500 CDDA sectors
File Size      : 5.95M
Bit Rate       : 793k
Sample Encoding: 24-bit FLAC
Comments       : 
ALBUM=Test-Sweeps
ARTIST=Audacity
COMMENT=60s logarithmic sweep (0-20kHz): 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
COMMENTS=60s logarithmisch
DATE=2016
TITLE=Sweep (0-20kHz at 96kHz) log
TRACKNUMBER=2


Input File     : 'file.ogg'
Channels       : 1
Sample Rate    : 96000
Precision      : 16-bit
Duration       : 00:01:00.00 = 5760000 samples ~ 4500 CDDA sectors
File Size      : 218k
Bit Rate       : 29.1k
Sample Encoding: Vorbis


Input File     : 'file.opus'
Channels       : 1
Sample Rate    : 48000
Precision      : 16-bit
Duration       : 00:01:00.00 = 2880000 samples ~ 4500 CDDA sectors
File Size      : 842k
Bit Rate       : 112k
Sample Encoding: Opus
Comment        : 'ENCODER=opusenc from opus-tools 0.2'


Input File     : 'file.wav'
Channels       : 1
Sample Rate    : 96000
Precision      : 24-bit
Duration       : 00:01:00.00 = 5760000 samples ~ 4500 CDDA sectors
File Size      : 17.3M
Bit Rate       : 2.30M
Sample Encoding: 24-bit Signed Integer PCM

Total Duration of 4 files: 00:04:00.00


$ ll file.*
-rw-r--r--  1 hans  wheel   5947093 Nov  4 17:17 file.flac                     
-rw-r--r--  1 hans  wheel    218397 Nov  4 17:23 file.ogg                      
-rw-r--r--  1 hans  wheel    842170 Nov  4 17:24 file.opus                     
-rw-r--r--  1 hans  wheel  17280080 Nov  4 17:18 file.wav  

So for me the opus file is four times the size of the ogg file.
Is that expected, for a frequency sweep?

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

Apparently it did (and also reduced the 24bit to 16bit).

> Why using 96kHz in the original: AFAIK Vorbis and Opus both use
> frequency components to encode the file.

What frequency components are those,
in a sweep from 0 to 20kHz?

> With higher sampling frequencies in the original,
> I was expecting to reduce the aliasing effects for higher frequencies.

What higher frequencies?


	Jan



> 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.
> 
> 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?
> 
> Anyway:
> 
> $ 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.
> 
>     Jan
> 
> 
> > 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
> http://lists.xiph.org/mailman/listinfo/opus
> 


More information about the opus mailing list