Opus tools issueshttps://gitlab.xiph.org/xiph/opus-tools/-/issues2023-08-15T19:00:41Zhttps://gitlab.xiph.org/xiph/opus-tools/-/issues/2319Remove unnecessary null pointer checks2023-08-15T19:00:41ZMarkus ElfringRemove unnecessary null pointer checks[Extra null pointer checks are not needed in functions](https://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first "Free a null pointer anyway or check first?") like the following.
* [main](https://gitlab.xip...[Extra null pointer checks are not needed in functions](https://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first "Free a null pointer anyway or check first?") like the following.
* [main](https://gitlab.xiph.org/xiph/opus-tools/-/blob/ec08f7bd88bf6598ad8b666b7c4d2c1162487838/src/opusdec.c#L1191)
* [op_free](https://gitlab.xiph.org/xiph/opus-tools/-/blob/ec08f7bd88bf6598ad8b666b7c4d2c1162487838/src/opusrtp.c#L200)https://gitlab.xiph.org/xiph/opus-tools/-/issues/2318Completion of error handling2023-08-15T18:44:57ZMarkus ElfringCompletion of error handlingWould you like to add more error handling for return values from functions like the following?
* [calloc](https://pubs.opengroup.org/onlinepubs/9699919799/functions/calloc.html "Memory allocation") ⇒ [create_stream_set](https://gitlab.x...Would you like to add more error handling for return values from functions like the following?
* [calloc](https://pubs.opengroup.org/onlinepubs/9699919799/functions/calloc.html "Memory allocation") ⇒ [create_stream_set](https://gitlab.xiph.org/xiph/opus-tools/-/blob/ec08f7bd88bf6598ad8b666b7c4d2c1162487838/src/opusinfo.c#L56)
* [fclose](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fclose.html "Close a stream") ⇒ [main](https://gitlab.xiph.org/xiph/opus-tools/-/blob/ec08f7bd88bf6598ad8b666b7c4d2c1162487838/src/opusenc.c#L673)https://gitlab.xiph.org/xiph/opus-tools/-/issues/2317Compiler warnings with comparing singed and unsigned ints2022-01-23T06:23:55ZAnders JenboCompiler warnings with comparing singed and unsigned intsThese are now the only compiler warnings left when building DevilutionX, would be great if we can handle them so we can start checking for compiler warnings in the CI :)
```
In file included from speex_resampler/resample.c:100:
speex_re...These are now the only compiler warnings left when building DevilutionX, would be great if we can handle them so we can start checking for compiler warnings in the CI :)
```
In file included from speex_resampler/resample.c:100:
speex_resampler/resample_sse.h:45:14: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for (i=0;i<len;i+=8)
~^~~~
speex_resampler/resample_sse.h:62:12: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(i=0;i<len;i+=2)
~^~~~
speex_resampler/resample_sse.h:84:14: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for (i=0;i<len;i+=8)
~^~~~
speex_resampler/resample_sse.h:110:12: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(i=0;i<len;i+=2)
~^~~~
speex_resampler/resample.c:674:20: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for (j=0;j<st->filt_len;j++)
~^~~~~~~~~~~~~
speex_resampler/resample.c:946:21: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(j=0;j<ichunk;++j)
~^~~~~~~
speex_resampler/resample.c:949:20: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(j=0;j<ichunk;++j)
~^~~~~~~
speex_resampler/resample.c:1001:19: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(j=0;j<ichunk;++j)
~^~~~~~~
speex_resampler/resample.c:1008:19: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(j=0;j<ichunk;++j)
~^~~~~~~
speex_resampler/resample.c:1018:16: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for (j=0;j<ochunk+omagic;++j)
~^~~~~~~~~~~~~~
```https://gitlab.xiph.org/xiph/opus-tools/-/issues/2316opusenc adds distortion-causing playback gain when encoding flac with replayg...2021-06-24T05:19:55ZeverettSFopusenc adds distortion-causing playback gain when encoding flac with replaygain tagsI could not find a solution to this after some searching. Basically, I have a collection of flac files that I convert to opus to save space on my phone. After the conversion they are incredibly distorted. It only happens to the flac f...I could not find a solution to this after some searching. Basically, I have a collection of flac files that I convert to opus to save space on my phone. After the conversion they are incredibly distorted. It only happens to the flac files that already have replaygain tags on them - opusenc on flac files that have no tags don't get a playback gain added.
[01_-_In_Between_Days.flac](/uploads/aadf88e78b382a326910df1b342e5909/01_-_In_Between_Days.flac)[01_-_In_Between_Days.opus](/uploads/c24f9e9da285a058d2850b8cb47c40a8/01_-_In_Between_Days.opus)
I use the "loudgain" utility and its included script, "rgbpm", to add the tags to my files.
I couldn't find a way to remove the gain tag, so my solution has been to use ogg/vorbis instead, which works great, but it would be nice to be able to use opus for this application. Thanks for any help, let me know if I'm missing something.https://gitlab.xiph.org/xiph/opus-tools/-/issues/2315Opusenc produces broken samples (wrong quantization) with 24-bit source2020-11-26T19:55:30ZstevenleleOpusenc produces broken samples (wrong quantization) with 24-bit source# Original Issue
I was encoding a specific sample of music (24 bits, 48 kHz) with `opusenc` in `opus-tools 0.2 (Opus 1.3)` and noticed a significant artifact in the beginning.
**More description:** You can hear the artifact within 00:01...# Original Issue
I was encoding a specific sample of music (24 bits, 48 kHz) with `opusenc` in `opus-tools 0.2 (Opus 1.3)` and noticed a significant artifact in the beginning.
**More description:** You can hear the artifact within 00:01. It's a broken "boom"-like sound.
Check the image below. The waveform graph has significant changes.
![comparison](/uploads/c4cc70aaf6ce4a578820caeb699f80dc/comparison.png)
This is how I encoded:
```
>opusenc sample.flac --bitrate 256 sample.opus
Encoding using libopus 1.3 (audio)
-----------------------------------------------------
Input: 48 kHz, 2 channels
Output: 2 channels (2 coupled)
20ms packets, 256 kbit/s VBR
Preskip: 312
Encoding complete
-----------------------------------------------------
Encoded: 1 minute and 31.1 seconds
Runtime: 1 second
(91.1x realtime)
Wrote: 2993392 bytes, 4555 packets, 94 pages
Bitrate: 261.351 kbit/s (without overhead)
Instant rates: 1.2 to 510.4 kbit/s
(3 to 1276 bytes per packet)
Overhead: 0.576% (container+metadata)
```
# Update
I tried using `FFmpeg` to convert the original file into 16 bits (original is 24 bits).
```
>ffmpeg -i sample.wav -f wav -c pcm_s16le sample_16bit.wav
```
Then I encoded again with the same settings.
```
>opusenc sample_16bit.wav --bitrate 256 sample_16bit.opus
Skipping chunk of type "LIST", length 26
Encoding using libopus 1.3 (audio)
-----------------------------------------------------
Input: 48 kHz, 2 channels
Output: 2 channels (2 coupled)
20ms packets, 256 kbit/s VBR
Preskip: 312
Encoding complete
-----------------------------------------------------
Encoded: 1 minute and 31.1 seconds
Runtime: 1 second
(91.1x realtime)
Wrote: 2990541 bytes, 4555 packets, 94 pages
Bitrate: 261.103 kbit/s (without overhead)
Instant rates: 1.2 to 510.4 kbit/s
(3 to 1276 bytes per packet)
Overhead: 0.576% (container+metadata)
```
The result turned out to be good.
Check the image below. The waveform graph has **no** significant changes now.
![comparison_2](/uploads/e1d820a879c854670ff562cd4b1e5d1d/comparison_2.png)
So there may be issue in quantization of 24-bit (or high bit depth?) samples.
# Sample Download
The updated sample files are [here](https://www.mediafire.com/file/jiat0cn2cjccu2y/sample_new.7z/file).
All source samples are converted to FLAC files for better compression.
The 16-bit sample is converted from the 24-bit one; the 24-bit one is the original, not padded.https://gitlab.xiph.org/xiph/opus-tools/-/issues/2314Release new version (and builds) with the libopusenc gapless bug fixed2020-07-05T02:18:05ZAmanRelease new version (and builds) with the libopusenc gapless bug fixedlibopusenc 0.2.1 includes xiph/libopusenc@a852e9fbfd7c360e9078d124e73ec6eef2665148, which fixed a bug with encoding tracks gaplessly. It will be great if you can cut a new release with this included.libopusenc 0.2.1 includes xiph/libopusenc@a852e9fbfd7c360e9078d124e73ec6eef2665148, which fixed a bug with encoding tracks gaplessly. It will be great if you can cut a new release with this included.https://gitlab.xiph.org/xiph/opus-tools/-/issues/2312Opus 32kbps file+cue split file after 6h45m23s787ms2018-05-13T08:51:37ZAndrey VolkovOpus 32kbps file+cue split file after 6h45m23s787msopus codec 32kbps (libopus 1.2-alpha and stable libopus 1.1.4)
flag --ignorelength
I have no select another flags or additions before converting.
mode: some files to one file+cue
Result:
Split on two pieces ("name"+"name" part 2+cue) ...opus codec 32kbps (libopus 1.2-alpha and stable libopus 1.1.4)
flag --ignorelength
I have no select another flags or additions before converting.
mode: some files to one file+cue
Result:
Split on two pieces ("name"+"name" part 2+cue) after convert, 6h45m23s:787ms instead of one file+cue
http://imgur.com/hMxjieg
http://imgur.com/cuap5X4
http://imgur.com/fkXSZ2J
http://imgur.com/zc72Kp7
I try two versions of codec in aimp converter (opusenc.exe) and convert another long record. Similar time when codec create another part.
http://imgur.com/8LRgphY
sorry for my english.
We tryin find the answer on aimp forum thread.
http://www.aimp.ru/forum/index.php?topic=55679.0
Andrey VolkovAndrey Volkovhttps://gitlab.xiph.org/xiph/opus-tools/-/issues/2297Add a "--bitrate-per-channel" or a "--quality" argument2018-05-13T08:51:36ZkuchikirukiaAdd a "--bitrate-per-channel" or a "--quality" argumentAs of now Opus doesn't have a setting equivalent to Vorbis, Nero AAC, or QAAC's VBR quality levels. This makes it difficult to batch encode multiple files with multiple channel configurations. With a quality level you can pick one sett...As of now Opus doesn't have a setting equivalent to Vorbis, Nero AAC, or QAAC's VBR quality levels. This makes it difficult to batch encode multiple files with multiple channel configurations. With a quality level you can pick one setting and the encoder will adjust the bitrate according to the channel layout: for example, QAAC @ q127 will target 320kbps for 2.0 channel and 768kbps for 5.1. This is a very handy feature.
If a --quality feature, may I suggest a naming scheme that has some relation to the bitrates output at 2.0? I mean, I'd have no idea what Vorbis' q=5.0 translates to without looking at a chart. QAAC, OTOH, seems to somewhat correspond to bitrate-per-channel in its q45-q91 range. This is pretty useful. I know to pick q91 if I want ~180k quality without needing to run off to a manual.
Mark HarrisMark Harrishttps://gitlab.xiph.org/xiph/opus-tools/-/issues/2274src/picture.c:465]: (error) Resource leak: picture_file2018-10-16T04:09:21ZDavid Bindermansrc/picture.c:465]: (error) Resource leak: picture_fileSource code is
free(buf);
*error_message="pictures of type 1 MUST be 32x32 PNGs";
return NULL;
Also:
src/picture.c:498]: (error) Resource leak: picture_file
Source code is
free(buf);
*error_message="pictures of type 1 MUST be 32x32 PNGs";
return NULL;
Also:
src/picture.c:498]: (error) Resource leak: picture_file
Mark HarrisMark Harrishttps://gitlab.xiph.org/xiph/opus-tools/-/issues/2165malformed opus file causes memory leak in opusdec2018-10-16T04:05:53Zhannomalformed opus file causes memory leak in opusdecThe attached file will cause several memory leaks in opusdec.
Found with the help of american fuzzy lop and clang's leak sanitizer:
```
==6060==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 27264 byte(s) in 1 object(s) al...The attached file will cause several memory leaks in opusdec.
Found with the help of american fuzzy lop and clang's leak sanitizer:
```
==6060==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 27264 byte(s) in 1 object(s) allocated from:
#0 0x7f66bb13925b in __interceptor_malloc (/mnt/ram/opus-1.1/opus-tools-0.1.9/opusdec+0xb625b)
#1 0x7f66baabe2e8 in opus_alloc /mnt/ram/opus-1.1/./celt/os_support.h:49:11
#2 0x7f66baabda22 in opus_multistream_decoder_create /mnt/ram/opus-1.1/src/opus_multistream_decoder.c:128:26
#3 0x7f66bb17e962 in process_header /mnt/ram/opus-1.1/opus-tools-0.1.9/src/opusdec.c:514:9
#4 0x7f66bb1763cf in main /mnt/ram/opus-1.1/opus-tools-0.1.9/src/opusdec.c:911:21
#5 0x7f66b922cf9f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.20-r1/work/glibc-2.20/csu/libc-start.c:289
Direct leak of 128 byte(s) in 1 object(s) allocated from:
#0 0x7f66bb1393b0 in calloc (/mnt/ram/opus-1.1/opus-tools-0.1.9/opusdec+0xb63b0)
#1 0x7f66bb186c39 in speex_alloc /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:68:45
#2 0x7f66bb183dd3 in opustools_resampler_init_frac /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:745:32
#3 0x7f66bb18364e in opustools_resampler_init /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:732:11
#4 0x7f66bb176ebd in main /mnt/ram/opus-1.1/opus-tools-0.1.9/src/opusdec.c:945:31
#5 0x7f66b922cf9f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.20-r1/work/glibc-2.20/csu/libc-start.c:289
Indirect leak of 51744 byte(s) in 1 object(s) allocated from:
#0 0x7f66bb1393b0 in calloc (/mnt/ram/opus-1.1/opus-tools-0.1.9/opusdec+0xb63b0)
#1 0x7f66bb186c39 in speex_alloc /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:68:45
#2 0x7f66bb18f375 in update_filter /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:598:43
#3 0x7f66bb186714 in opustools_resampler_init_frac /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:785:4
#4 0x7f66bb18364e in opustools_resampler_init /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:732:11
#5 0x7f66bb176ebd in main /mnt/ram/opus-1.1/opus-tools-0.1.9/src/opusdec.c:945:31
#6 0x7f66b922cf9f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.20-r1/work/glibc-2.20/csu/libc-start.c:289
Indirect leak of 1976 byte(s) in 1 object(s) allocated from:
#0 0x7f66bb1393b0 in calloc (/mnt/ram/opus-1.1/opus-tools-0.1.9/opusdec+0xb63b0)
#1 0x7f66bb186c39 in speex_alloc /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:68:45
#2 0x7f66bb1958f6 in update_filter /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:653:32
#3 0x7f66bb186714 in opustools_resampler_init_frac /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:785:4
#4 0x7f66bb18364e in opustools_resampler_init /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:732:11
#5 0x7f66bb176ebd in main /mnt/ram/opus-1.1/opus-tools-0.1.9/src/opusdec.c:945:31
#6 0x7f66b922cf9f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.20-r1/work/glibc-2.20/csu/libc-start.c:289
Indirect leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x7f66bb1393b0 in calloc (/mnt/ram/opus-1.1/opus-tools-0.1.9/opusdec+0xb63b0)
#1 0x7f66bb186c39 in speex_alloc /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:68:45
#2 0x7f66bb1856cb in opustools_resampler_init_frac /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:771:36
#3 0x7f66bb18364e in opustools_resampler_init /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:732:11
#4 0x7f66bb176ebd in main /mnt/ram/opus-1.1/opus-tools-0.1.9/src/opusdec.c:945:31
#5 0x7f66b922cf9f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.20-r1/work/glibc-2.20/csu/libc-start.c:289
Indirect leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x7f66bb1393b0 in calloc (/mnt/ram/opus-1.1/opus-tools-0.1.9/opusdec+0xb63b0)
#1 0x7f66bb186c39 in speex_alloc /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:68:45
#2 0x7f66bb185886 in opustools_resampler_init_frac /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:772:39
#3 0x7f66bb18364e in opustools_resampler_init /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:732:11
#4 0x7f66bb176ebd in main /mnt/ram/opus-1.1/opus-tools-0.1.9/src/opusdec.c:945:31
#5 0x7f66b922cf9f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.20-r1/work/glibc-2.20/csu/libc-start.c:289
Indirect leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x7f66bb1393b0 in calloc (/mnt/ram/opus-1.1/opus-tools-0.1.9/opusdec+0xb63b0)
#1 0x7f66bb186c39 in speex_alloc /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:68:45
#2 0x7f66bb185a41 in opustools_resampler_init_frac /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:773:39
#3 0x7f66bb18364e in opustools_resampler_init /mnt/ram/opus-1.1/opus-tools-0.1.9/src/resample.c:732:11
#4 0x7f66bb176ebd in main /mnt/ram/opus-1.1/opus-tools-0.1.9/src/opusdec.c:945:31
#5 0x7f66b922cf9f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.20-r1/work/glibc-2.20/csu/libc-start.c:289
```Mark HarrisMark Harrishttps://gitlab.xiph.org/xiph/opus-tools/-/issues/2132opus-tools: Progress in percent never shown2018-05-13T08:51:37ZRillke (Wikimedia)opus-tools: Progress in percent never shownThere is code in opus-tools:master:opusenc.c:1039 that appears to be there for showing progress in %, though it's in an `if()` condition that is only executed when there is more encoded data than total samples per channel.
Never worked w...There is code in opus-tools:master:opusenc.c:1039 that appears to be there for showing progress in %, though it's in an `if()` condition that is only executed when there is more encoded data than total samples per channel.
Never worked with track before; trying to attach a patch file.Jean-Marc ValinJean-Marc Valinhttps://gitlab.xiph.org/xiph/opus-tools/-/issues/2044opus-tools-0.1.9 can not encode samples with !48000 sample rate.2018-05-13T08:51:37Zsnaixopus-tools-0.1.9 can not encode samples with !48000 sample rate.I have test the opus-tools 1.1 to encode wav to opus(ogg container).
But I found that opus-tools output opus just with 48000 sample rate.
for example: I give a wav which is 20500 sample rate; in code, I think opus tools will resample it ...I have test the opus-tools 1.1 to encode wav to opus(ogg container).
But I found that opus-tools output opus just with 48000 sample rate.
for example: I give a wav which is 20500 sample rate; in code, I think opus tools will resample it with speex resampler in 24000 sample rate. but the output opus file always is 48000.Jean-Marc ValinJean-Marc Valinhttps://gitlab.xiph.org/xiph/opus-tools/-/issues/1964opusenc: Does not support choosing Opus application2018-05-13T08:51:37ZTimothy Guopusenc: Does not support choosing Opus applicationThere isn't an option to choose the application of the output Opus stream (Audio/VoIP/Low-Latency).There isn't an option to choose the application of the output Opus stream (Audio/VoIP/Low-Latency).Jean-Marc ValinJean-Marc Valinhttps://gitlab.xiph.org/xiph/opus-tools/-/issues/1932opus-tools requires a certain order of arguments2018-05-13T08:51:37Zazaqielopus-tools requires a certain order of argumentswhen encoding with opusenc.exe, version 0.1.6 (using libopus 1.1-alpha) downloaded from mozilla.org, this does not work:
` opusenc output.opus infile.wav `
and gives the error:
` output.opus: No such file or directory `
however, this...when encoding with opusenc.exe, version 0.1.6 (using libopus 1.1-alpha) downloaded from mozilla.org, this does not work:
` opusenc output.opus infile.wav `
and gives the error:
` output.opus: No such file or directory `
however, this does work:
` opusenc infile.wav output.opus `
this is not huge at all in my opinion, just causes a little confusion. especially when foobar2000 is involved, which gives the most vague error available.Jean-Marc ValinJean-Marc Valinhttps://gitlab.xiph.org/xiph/opus-tools/-/issues/1930Cannot install opus tools in CentOS 32 bit2018-05-13T08:51:37ZAnitaCannot install opus tools in CentOS 32 bitHi,
I need to install opus-tools in a CentOS 32-bit machine,
I've installed libogg and opus already,
but when i install opus-tools, it says that it cannot find "opus",
I've added --with-ogg-libraries, --with-ogg-includes, --with-opus-l...Hi,
I need to install opus-tools in a CentOS 32-bit machine,
I've installed libogg and opus already,
but when i install opus-tools, it says that it cannot find "opus",
I've added --with-ogg-libraries, --with-ogg-includes, --with-opus-libraries, and --with-opus-includes already, but still failed.
I successfully installed it in another 64-bit machine, however I really need to install it in the 32-bit one.
Any solution?
libogg version: 1.3.0
opus version: 1.0.1 and 1.0.2 tried
opus-tools version: 0.1.5 and 0.1.6 tried
Thanks a lot!Jean-Marc ValinJean-Marc Valin