That would be highly unusual. Can you give us a sample of the output and the commandline or call to the encoder? My suspicion is that it might be in CBR mode using padding bits. -Em On Fri, Apr 16, 2021 at 11:09 AM Jesus Cea <jcea at jcea.es> wrote:> I am encoding a minute of absolute mono silence (WAV with wave = 0 > values) and the resulting file is quite big, translating to about 52Kbps. > > Quite high for a silence only segment. > > I wonder why is so innefficient. Anybody knows? > > Any workaround?. Would DTX ctl works to create a OPUS file with "opusenc"? > > -- > Jesús Cea Avión _/_/ _/_/_/ _/_/_/ > jcea at jcea.es - https://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/ > Twitter: @jcea _/_/ _/_/ _/_/_/_/_/ > jabber / xmpp:jcea at jabber.org _/_/ _/_/ _/_/ _/_/ _/_/ > "Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/ > "My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/ > "El amor es poner tu felicidad en la felicidad de otro" - Leibniz > > _______________________________________________ > opus mailing list > opus at xiph.org > http://lists.xiph.org/mailman/listinfo/opus >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/opus/attachments/20210416/40ed0182/attachment.html>
Jesus Cea
2021-Apr-19 18:54 UTC
[opus] Audacity adds noise to silence! (Was: Why silence is encoded with so many bits?)
On 17/4/21 2:40, Emily Bowman wrote:> That would be highly unusual. Can you give us a sample of the output and > the commandline or call to the encoder? My suspicion is that it might be > in CBR mode using padding bits.Steps to reproduce: 1. Open audacity: https://www.audacityteam.org/ 2. Create an audio of a minute of absolute silence. 3. Export as WAV. 4. From the command line, write "opusenc silence.wav silence.opus". The output: """ jcea at jcea:/tmp/ram$ opusenc silence.wav silence.opus Encoding using libopus 1.3.1 (audio) ----------------------------------------------------- Input: 44.1 kHz, 1 channel Output: 1 channel (1 uncoupled) 20ms packets, 64 kbit/s VBR Preskip: 312 Encoding complete ----------------------------------------------------- Encoded: 1 minute and 0.02 seconds Runtime: 0 seconds Wrote: 422950 bytes, 3001 packets, 63 pages Bitrate: 55.6429 kbit/s (without overhead) Instant rates: 42.4 to 86.4 kbit/s (106 to 216 bytes per packet) Overhead: 1.3% (container+metadata) jcea at jcea:/tmp/ram$ ls -la silence.* -rw-rw-r-- 1 jcea jcea 422950 abr 19 17:30 silence.opus -rw-rw-r-- 1 jcea jcea 5292044 abr 19 17:28 silence.wav """ A minute of absolute silence is encoded as a 422Kbytes file, 55Kbps bitrate!. Studying the audacity generated WAV file, I noticed it is not actually absolute silence!. It is a very faint noise. For instance, exporting a 16 bits PCM audio WAV file and checking the file by hand I see values +-3 at random. The last three bits seems random. Maybe Audacity is adding dithering when exporting to WAV. That "dithering" is done even when exporting to 32 bit float wav. With this new realization, I looked up "audacity wav export dithering" and I got this webpage: https://manual.audacityteam.org/man/dither.html In that page they say that dithering is applied in all exports except 32 bits PCM audio... but "opusenc" notably doesn't supports that format: """ jcea at jcea:/tmp/ram$ opusenc silence.wav silence.opus ERROR: Unsupported WAV sample size. Must be 8, 16, or 24 bit PCM or 32 bit floating point PCM. Error: unsupported input file: silence.wav """ Disabling dithering and exporting a REAL silence, I get a bitrate of 1.2Kbps. That seems pretty acceptable. Sorry for wasting your time, but I think this email might be useful to other people. Thanks. PS: Would be interesting to use "OPUS_SET_LSB_DEPTH" ctl call to signal "signal under x dB is silence": "opusenc --set-ctl-int 4036=12 silence.wav silence.opus". I don't know if Opus would just use "12 bits" or rather consider silence if the signal power is below 12 bits, but use the full range when signal is present. If it is the second case, I could even use only 8 bits for silence detection, but encode 16 bits when signal is present. -- Jesús Cea Avión _/_/ _/_/_/ _/_/_/ jcea at jcea.es - https://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/ Twitter: @jcea _/_/ _/_/ _/_/_/_/_/ jabber / xmpp:jcea at jabber.org _/_/ _/_/ _/_/ _/_/ _/_/ "Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/ "My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/ "El amor es poner tu felicidad en la felicidad de otro" - Leibniz -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 495 bytes Desc: OpenPGP digital signature URL: <http://lists.xiph.org/pipermail/opus/attachments/20210419/03fef219/attachment.sig>