Giter VIP home page Giter VIP logo

opus-tools's People

Contributors

bitllama avatar chocobo1 avatar chris-hld avatar eblanca avatar felicialim avatar flameeyes avatar gcp avatar giavac avatar gmaxwell avatar jmvalin avatar karlt avatar kode54 avatar lordmulder avatar mark4o avatar mattgwwalker avatar mgraczyk avatar misterzeus avatar moisespr123 avatar rillian avatar stephengroat avatar tdaede avatar tmatth avatar wiiaboo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opus-tools's Issues

behavior difference for opus-tools and opus_demo

i encode and decode a wav or pcm file with 16khz sample rate.

the result pcm of opus_demo binary by opus source code contains all frequency information between 0-8khz.

the result wav of opusenc opusdec binary by opus-tool contains frequency information between about 0-7.5khz.

why there is difference for the output audio's frequency information ?

thanks.

FEC not enabled

Hi,

opusenc does not enable fec even if expect-loss is not zero. Only the expected loss is passed to libopus, inband_fec is not set.
We used the following revisions.
libopusenc-0.2.1
opus-1.3.1
opusfile-0.12
opus-tools-0.2

Regards,
Viktor

Windows MinGW Compiling

Hello, I have been trying to use opus libs for months now but I can't achieve it.

If someone could tell me how exactly compile executable decoder/encoder for Windows using MinGW, I would be very grateful.

Because the only real answer I found (if don't want to use Visual Studio) is: Use executables...

Thank you

Resampler stride

How does speex_resampler_set_input_stride and speex_resampler_set_output_stride work?
Is the stride intended to be the number of bytes or samples until the next frame in speex_resampler_process_interleaved_float?
It doesn't look like it, since its default value is 1. I would expect it to be nb_channels * sizeof(float).

Support for WebP thumbnails via --picture

The --picture options allows either a specification as

[TYPE]|[MEDIA-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILENAME

Or just a filename.WEBP

I can understand that when specifying just the filename, only jpeg, png and gif are supported, since all the parameters (dimensions, depth and media-type) have to be inferred.

The thing is that even when specifying all the parameters for a webp image, it's still not supported since part of the code verifies whether the image is one of the recognized formats.

This seems senseless to me and I would like to be able to specify whatever parameters I want via the full spec.

`--hard-cbr` is not respected when frame size is set to 60 sometimes

Version

opusenc opus-tools 0.2 (using libopus 1.3.1)
Copyright (C) 2008-2018 Xiph.Org Foundation

Command

ffmpeg -f lavfi -i anullsrc=channel_layout=5.1:sample_rate=48000 -t 1.201 silence.wav
opusenc --bitrate 64 --hard-cbr --music --framesize 60 --comp 0 --discard-comments --discard-pictures --save-range range silence.wav silence.ogg

Range file

2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
2880, 480, [[3, 157, 157, 157], MDCT, FB, S, 960, 16777216]
960, 160, [[1, 159], MDCT, FB, S, 960, 16777216]

Is it expected?

Opusenc: Pre-skip doesn't include extra_samples

On page 27 of "Ogg Encapsulation for the Opus Audio Codec" [1], the recommendations for encoders is to have a pre-skip value of (delay_samples + extra_samples). Extra_samples is defined there as at least 120 samples.

However, opusenc has a pre-skip of just delay_samples (see line 1008 of opusenc.c).

Why is this? Is this an oversight that should be corrected? Or, is the explanation in the RFC incorrect?

Cheers,

Matthew

[1] https://tools.ietf.org/html/rfc7845#page-27

flac Error parsing input file:

i tried first debian sid package, then compiled from this github source 0.1.10 same result Error parsing input file. Is flac support broken, or are debian dev packages wrong?

opusdec to wav wrong length of wav-file

Got this several times...

if i opusdec one opusfile ta wav;
opusdec "RE WS 033 yy-mm-dd.opus" "RE WS 033 yy-mm-dd.wav"
Decoding to 48000 Hz (2 channels)
Encoded with Lavf57.83.100
language=ger
DURATION=03:39:14.641000000
encoder=Lavf57.83.100
Decoding complete. ``

In terminal it shows the correct time; but if i open that wav file; it shows the wrong time...
vlc, mpv, different players show the wrong time...
i deleted those "bad" files and restarted re-re-decoding but anytime the same issue guess problem is anywhere...anywhere the same problem... anywhere is a cachefile or sth. for the media preview or tag or sth. else; dont think its a decoding / opusdec issue...

This wasnt the end of encoding: target is mp3; but this issue makes it hard to finish work on files.

opus_custom_decode() can't decode the custom stream while set sample rate less 24K

The following code is a bat file to convert .wav to an Opus stream.

for %%s in (music\*.wav) do ( 
	if %%~zs neq 0 (
		opusenc --bitrate 128 --vbr --music --comp 0 --framesize 10 --downmix-mono --discard-comments --discard-pictures %%s	%%~ns.ops
		opusdec --rate 16000 %%~ns.ops %%~ns.pcm
		del %%~ns.ops /q
		opus_demo  -e audio 16000 1 -cvbr -framesize 10 -max_payload 160 -complexity 0 -forcemono %%~ns.pcm %%~ns.ops
		del %%~ns.pcm /q
	)
)

If you use opus_decode() decoding, it works fine, return frame size = 160.
When I decode with opus_custom_decode(), an error value is returned, return frame size = 40.

Enabling Ambisonic Encoding

Hi there,

I was following this thread about the --enable-ambisonic flag. Are there instructions to enable the ambisonic API with the opusenc cli? The documentation for 1.3 mentions support for channel mapping families 2 and 3, but it's unclear where I can configure this.

Right now the layout is being set to quad rather than 'ambisonic 1'

Input #0, ogg, from '.\ambisonic_opusenc.opus':
  Duration: 00:00:29.04, start: 0.000000, bitrate: 185 kb/s
  Stream #0:0: Audio: opus, 48000 Hz, quad, fltp
    Metadata:
      ENCODER         : opusenc from opus-tools 0.2-3-gf5f571b

Here's an output using ffmpeg to transcode audio:

Input #0, ogg, from '.\ambisonic_ffmpeg_2.opus':
  Duration: 00:00:29.04, start: 0.000000, bitrate: 113 kb/s
  Stream #0:0: Audio: opus, 48000 Hz, ambisonic 1, fltp
    Metadata:
      encoder         : Lavc59.51.100 libopus

opusenc: Unsupported FLAC input file

opusenc fails on some input FLAC files with a generic error:

$ opusenc --bitrate 160 1.{flac,opus}
Error: unsupported input file: 1.flac

$ file 1.flac
1.flac: Audio file with ID3 version 2.4.0, contains:FLAC audio bitstream data, 24 bit, stereo, 96 kHz, 28360569 samples

These FLAC files play without issue and are verified ok by flac -t.

$ opusenc --version
opusenc opus-tools 0.2 (using libopus 1.3.1)
Copyright (C) 2008-2018 Xiph.Org Foundation

compilation failed against libopus 1.2.1 static

opus-tools-0.1.10 compilation failed against static libopus 1.2.1
Ubuntu 17.04 x64, gcc 6.3.0

Making distclean in .
make[1]: Entering directory '/tmp/_packages/opus/opus-tools-0.1.10'
Making uninstall in .
test -z "opusenc opusdec opusinfo" || rm -f opusenc opusdec opusinfo
test -z "opusrtp" || rm -f opusrtp
rm -f *.o
rm -f src/*.o
rm -f win32/*.o
rm -f *.tab.c
make[1]: Entering directory '/tmp/_packages/opus/opus-tools-0.1.10'
test -z "" || rm -f 
test . = "." || test -z "" || rm -f 
rm -f src/.deps/.dirstamp
rm -f src/.dirstamp
 ( cd '/tmp/_packages/opus/build/bin' && rm -f opusenc opusdec opusinfo )
rm -f win32/.deps/.dirstamp
rm -f win32/.dirstamp
rm -f config.h stamp-h1
 ( cd '/tmp/_packages/opus/build/share/man/man1' && rm -f opusenc.1 opusdec.1 opusinfo.1 )
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
make[1]: Leaving directory '/tmp/_packages/opus/opus-tools-0.1.10'
rm -f cscope.out cscope.in.out cscope.po.out cscope.files
make[1]: Leaving directory '/tmp/_packages/opus/opus-tools-0.1.10'
rm -f config.status config.cache config.log configure.lineno config.status.lineno
rm -rf src/.deps win32/.deps
rm -f Makefile
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-linux-gnu-strip... x86_64-linux-gnu-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for style of include used by make... GNU
checking for x86_64-linux-gnu-gcc... x86_64-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-linux-gnu-gcc accepts -g... yes
checking for x86_64-linux-gnu-gcc option to accept ISO C89... none needed
checking whether x86_64-linux-gnu-gcc understands -c and -o together... yes
checking dependency style of x86_64-linux-gnu-gcc... gcc3
checking for x86_64-linux-gnu-gcc option to accept ISO C99... none needed
checking how to run the C preprocessor... x86_64-linux-gnu-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for C/C++ restrict keyword... __restrict
checking for C99 variable-size arrays... yes
checking for cos in -lm... yes
checking for main in -lwinmm... no
checking for pkg-config... yes
checking for x86_64-linux-gnu-pkg-config... /usr/bin/x86_64-linux-gnu-pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for OGG... yes
checking for OPUS... yes
checking sys/soundcard.h usability... yes
checking sys/soundcard.h presence... yes
checking for sys/soundcard.h... yes
checking for sio_open in -lsndio... no
checking for FLAC... yes
checking for pcap_open_live in -lpcap... no
checking if x86_64-linux-gnu-gcc supports -fstack-protector-all... yes
checking for PIE support... no
checking if x86_64-linux-gnu-gcc supports -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for lrintf... yes
checking for fminf... yes
checking for fmaxf... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
configure:
------------------------------------------------------------------------
  opus-tools 0.1.10:  Automatic configuration OK.

    Compiler support:

      C99 var arrays: ................ yes
      C99 lrintf: .................... yes
      Stack protector: ............... yes
      PIE: ........................... no

    General configuration:

      Assertion checking: ............ no
      FLAC input: .................... yes

------------------------------------------------------------------------

 Type "make; make install" to compile and install

Making clean in .
make[1]: Entering directory '/tmp/_packages/opus/opus-tools-0.1.10'
test -z "opusenc opusdec opusinfo" || rm -f opusenc opusdec opusinfo
test -z "opusrtp" || rm -f opusrtp
rm -f *.o
rm -f src/*.o
rm -f win32/*.o
make[1]: Leaving directory '/tmp/_packages/opus/opus-tools-0.1.10'
Making install in .
make[1]: Entering directory '/tmp/_packages/opus/opus-tools-0.1.10'
  CC       src/opusdec-opus_header.o
  CC       src/opusdec-wav_io.o
  CC       src/opusdec-wave_out.o
  CC       src/opusdec-opusdec.o
  CC       src/opusdec-resample.o
In file included from src/resample.c:101:0:
src/resample_sse.h: In function 'inner_product_single':
src/resample_sse.h:47:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i=0;i<len;i+=8)
                 ^
src/resample_sse.h:59:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i=0;i<len;i++) ret += a[i] * b[i];
                 ^
In file included from src/resample.c:101:0:
src/resample_sse.h: In function 'interpolate_product_single':
src/resample_sse.h:72:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(i=0;i<len;i+=2)
              ^
src/resample_sse.h:85:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(i=0;i<len;i++)
              ^
src/resample_sse.h: In function 'inner_product_double':
src/resample_sse.h:108:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i=0;i<len;i+=8)
              ^
src/resample_sse.h: In function 'interpolate_product_double':
src/resample_sse.h:134:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0;i<len;i+=2)
            ^
src/resample.c: In function 'update_filter':
src/resample.c:607:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          for (j=0;j<st->filt_len;j++)
                    ^
src/resample.c:688:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (j=0;j<st->magic_samples[i];j++)
                       ^
src/resample.c:696:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (j=0;j<olen-1;j++)
                       ^
src/resample.c:699:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (;j<st->filt_len-1;j++)
                    ^
src/resample.c:706:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (j=0;j<st->filt_len-1+st->magic_samples[i];j++)
                       ^
src/resample.c: In function 'opustools_resampler_process_float':
src/resample.c:872:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
            for(j=0;j<ichunk;++j)
                     ^
src/resample.c:875:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
           for(j=0;j<ichunk;++j)
                    ^
src/resample.c: In function 'opustools_resampler_process_int':
src/resample.c:928:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          for(j=0;j<ichunk;++j)
                   ^
src/resample.c:935:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          for(j=0;j<ichunk;++j)
                   ^
src/resample.c:945:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      for (j=0;j<ochunk+omagic;++j)
                ^
  CC       src/opusdec-diag_range.o
  CC       win32/opusdec-unicode_support.o
  CC       src/opusinfo-opus_header.o
  CC       src/opusinfo-opusinfo.o
  CC       src/opusinfo-info_opus.o
  CC       src/opusinfo-picture.o
  CC       win32/opusinfo-unicode_support.o
  CC       src/opusrtp.o
  CC       src/opusenc-opus_header.o
  CC       src/opusenc-opusenc.o
  CC       src/opusenc-picture.o
  CC       src/opusenc-resample.o
In file included from src/resample.c:101:0:
src/resample_sse.h: In function 'inner_product_single':
src/resample_sse.h:47:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i=0;i<len;i+=8)
                 ^
src/resample_sse.h:59:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i=0;i<len;i++) ret += a[i] * b[i];
                 ^
In file included from src/resample.c:101:0:
src/resample_sse.h: In function 'interpolate_product_single':
src/resample_sse.h:72:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(i=0;i<len;i+=2)
              ^
src/resample_sse.h:85:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(i=0;i<len;i++)
              ^
src/resample_sse.h: In function 'inner_product_double':
src/resample_sse.h:108:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i=0;i<len;i+=8)
              ^
src/resample_sse.h: In function 'interpolate_product_double':
src/resample_sse.h:134:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0;i<len;i+=2)
            ^
src/resample.c: In function 'update_filter':
src/resample.c:607:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          for (j=0;j<st->filt_len;j++)
                    ^
src/resample.c:688:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (j=0;j<st->magic_samples[i];j++)
                       ^
src/resample.c:696:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (j=0;j<olen-1;j++)
                       ^
src/resample.c:699:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (;j<st->filt_len-1;j++)
                    ^
src/resample.c:706:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (j=0;j<st->filt_len-1+st->magic_samples[i];j++)
                       ^
src/resample.c: In function 'opustools_resampler_process_float':
src/resample.c:872:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
            for(j=0;j<ichunk;++j)
                     ^
src/resample.c:875:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
           for(j=0;j<ichunk;++j)
                    ^
src/resample.c: In function 'opustools_resampler_process_int':
src/resample.c:928:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          for(j=0;j<ichunk;++j)
                   ^
src/resample.c:935:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          for(j=0;j<ichunk;++j)
                   ^
src/resample.c:945:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      for (j=0;j<ochunk+omagic;++j)
                ^
  CC       src/opusenc-audio-in.o
  CC       src/opusenc-diag_range.o
  CC       src/opusenc-flac.o
  CC       src/opusenc-lpc.o
  CC       win32/opusenc-unicode_support.o
  CCLD     opusdec
  CCLD     opusinfo
  CCLD     opusrtp
  CCLD     opusenc
/tmp/_packages/opus/build/lib/libopus.a(bands.o): In function `compute_theta':
bands.c:(.text+0x11cb): undefined reference to `sqrtf'
bands.c:(.text+0x1219): undefined reference to `sqrtf'
/tmp/_packages/opus/build/lib/libopus.a(bands.o): In function `quant_band':
bands.c:(.text+0x2541): undefined reference to `sqrt'
/tmp/_packages/opus/build/lib/libopus.a(bands.o): In function `quant_band_stereo':
bands.c:(.text+0x31e0): undefined reference to `sqrtf'
bands.c:(.text+0x3211): undefined reference to `sqrtf'
/tmp/_packages/opus/build/lib/libopus.a(bands.o): In function `compute_band_energies':
bands.c:(.text+0x349e): undefined reference to `sqrtf'
/tmp/_packages/opus/build/lib/libopus.a(bands.o): In function `denormalise_bands':
bands.c:(.text+0x36de): undefined reference to `exp'
/tmp/_packages/opus/build/lib/libopus.a(bands.o): In function `anti_collapse':
bands.c:(.text+0x384e): undefined reference to `exp'
bands.c:(.text+0x392f): undefined reference to `exp'
bands.c:(.text+0x3ae1): undefined reference to `sqrt'
/tmp/_packages/opus/build/lib/libopus.a(opus_decoder.o): In function `opus_decode_frame':
opus_decoder.c:(.text+0xdfe): undefined reference to `exp'
/tmp/_packages/opus/build/lib/libopus.a(celt_decoder.o): In function `celt_decode_lost':
celt_decoder.c:(.text+0x2747): undefined reference to `sqrtf'
celt_decoder.c:(.text+0x2782): undefined reference to `sqrtf'
/tmp/_packages/opus/build/lib/libopus.a(pitch.o): In function `remove_doubling':
pitch.c:(.text+0x1073): undefined reference to `sqrtf'
pitch.c:(.text+0x10a1): undefined reference to `sqrtf'
/tmp/_packages/opus/build/lib/libopus.a(quant_bands.o): In function `quant_coarse_energy_impl.isra.3':
quant_bands.c:(.text+0x1ea): undefined reference to `floorf'
/tmp/_packages/opus/build/lib/libopus.a(quant_bands.o): In function `quant_fine_energy':
quant_bands.c:(.text+0xce2): undefined reference to `floorf'
/tmp/_packages/opus/build/lib/libopus.a(quant_bands.o): In function `amp2Log2':
quant_bands.c:(.text+0x152d): undefined reference to `log'
/tmp/_packages/opus/build/lib/libopus.a(vq.o): In function `exp_rotation.part.0.constprop.2':
vq.c:(.text+0x64): undefined reference to `cos'
vq.c:(.text+0x95): undefined reference to `cos'
/tmp/_packages/opus/build/lib/libopus.a(vq.o): In function `exp_rotation':
vq.c:(.text+0x9e0): undefined reference to `cos'
vq.c:(.text+0xa11): undefined reference to `cos'
/tmp/_packages/opus/build/lib/libopus.a(vq.o): In function `op_pvq_search_c':
vq.c:(.text+0x1eb6): undefined reference to `floorf'
/tmp/_packages/opus/build/lib/libopus.a(vq.o): In function `alg_quant':
vq.c:(.text+0x27b6): undefined reference to `cos'
vq.c:(.text+0x27e5): undefined reference to `cos'
vq.c:(.text+0x3234): undefined reference to `sqrtf'
/tmp/_packages/opus/build/lib/libopus.a(vq.o): In function `alg_unquant':
vq.c:(.text+0x36ff): undefined reference to `sqrtf'
/tmp/_packages/opus/build/lib/libopus.a(vq.o): In function `renormalise_vector':
vq.c:(.text+0x38a9): undefined reference to `sqrtf'
/tmp/_packages/opus/build/lib/libopus.a(vq.o): In function `stereo_itheta':
vq.c:(.text+0x39de): undefined reference to `floorf'
vq.c:(.text+0x3a7b): undefined reference to `floorf'
vq.c:(.text+0x3afe): undefined reference to `sqrtf'
vq.c:(.text+0x3b29): undefined reference to `sqrtf'
collect2: error: ld returned 1 exit status
Makefile:615: recipe for target 'opusrtp' failed
make[1]: *** [opusrtp] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/tmp/_packages/opus/opus-tools-0.1.10'
Makefile:1009: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

generates wavs with a 46-byte I think Sox stat fails

Opusdec using the MLcommons word dataset english

Samples read:                 0
Length (seconds):      0.000000
Scaled by:         2147483647.0
Maximum amplitude:     0.000000
Minimum amplitude:     0.000000
Midline amplitude:     0.000000
Mean    norm:              -nan
Mean    amplitude:         -nan
RMS     amplitude:         -nan
Maximum delta:         0.000000
Minimum delta:         0.000000
Mean    delta:        -0.000000
RMS     delta:        -0.000000
Rough   frequency:  -2147483648

Probably text, not sound

Sox stat output but will open in audacity so presume its the header?

Add "--force-mono" or "--disable-phase-inv" to opusdec

As specified on the opus update on section 10 the decoder can disable phase inversion so that downmixing to mono sounds good.

I suggest a "--force-mono" option with the phase inversion already disabled, so that decoding to mono doesn't sound bad.

As an example, ffmpeg does have an option to disable phase inversion (-apply_phase_inv false) but it doesn't downmix it to mono until "-ac 1" is used before the output.

I would make a pull request, but I don't know how to code yet 😢

how to read the original data of opus file into python/numpy array?

I am not familiar with the format of opus file (after I opusenc in.wav out.opus).
How many bytes are in the head of out.opus? Are the rest all actual audio encoded data (2 bytes for each)? Are there any other non-data bytes in the tail?

Could any one can post a sample code to help me to read the out.opus into python/numpy array with Uint16 format? I do not need to decode the out.opus file, I just need the original encoded data in the out.opus file.

Thank you very much

Force channel decoupling

I am using telephony system that can record calls into 8kHz stereo WAV files; it uses left channel for one participant and right channel for another.
To be able to process files later, I need strong channel separation (I mean, they should be encoded naturally as separate channels).

Opus seems to be perfect for my application; but still, there is no channel-independent encoding option in opusenc tool.
I am quite new in audio and stuff; but have I checked Opus RFC and Opus codebase - it seems it actually supports channel separation via 'coupling' concept.
I think, it would be enough to add some option to set header.channel_mapping=255 around line 695 in opusenc.c.
I checked if that would work - it worked like intended.

I can make pull-request here, if you think its acceptable to add option like 'no-coupling' that will explicitly set header.channel_mapping=255 somewhere after that line.

opusdec playing decoded output audio

I see opusdec is built with ability to send output to sound card when not specifying any output files.
This is because on my system I have alsa (or sndio) dev packages installed and they are detected during configure script.
Is there any ways to tell configure not to include them? (and having opusdec only decode into files)

[Feature Request] Fixed frame- / pagesize

I am currently in a project were we try to encode opus files into a specific custom file format.
There is a non opus file header first (usally 0x200 length). Then the real opus "file" starts.

Specialty: Every Opus Frame / Page has to start at a 0x1000 of the file or multiply of that. So the first page has to be 0x800 long, all following pages 0x1000.

Could somebody hint me how and where to implement it to opus-tools / libopusenc?

The manufacturer seemed to have use opus-tools or a custom fork of it for that:

                tags.Comment = "Lavf56.40.101";
                tags.Fields["encoder"] = "opusenc from opus-tools 0.1.9";
                tags.Fields["encoder_options"] = "--quiet --bitrate 96 --vbr";
                tags.Fields["pad"] = new string('0', 0x138);

Our custom C# encoder tool doing extact that
I think there is an extension of https://github.com/xiph/libopusenc needed
Audio Format Description

Opusenc from git fails to encode very short flac files on windows

Hi.
I made an issue about this in the opus repo but it's related to opus-tools instead.
When I try to encode a short flac file with opusenc it says:
ERROR: Could not open FLAC stream.
Error: unsupported input file: synth1.flac
I compiled opus-tools 0.2 with dynamic libflac and that worked, but not the version from git, neither dynamic or static. (Haven't tried 0.2 static yet).
I can try to bisect it, but as I get no audio by inverting a file with the git version and 0.2 it's really low priority.
But if you know of a git change after 0.2 that has to do with flac input that might be it.
Thanks,
Marc

Use Smart HTTP protocol on git.xiph.org site

This is actually an issue of the https://git.xiph.org/ site and applies to all repos hosted.
https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#The-HTTP-Protocols

Fail clone from git.xiph.org:

> git clone https://git.xiph.org/opus-tools.git --depth 1
Cloning into 'opus-tools'...
fatal: dumb http transport does not support --depth

Successful clone from github:

> git clone https://github.com/xiph/opus-tools.git --depth 1
Cloning into 'opus-tools'...
remote: Counting objects: 71, done.
remote: Compressing objects: 100% (61/61), done.
remote: Total 71 (delta 11), reused 47 (delta 8), pack-reused 0
Unpacking objects: 100% (71/71), done.
Checking connectivity... done.

opusenc/windows: lost some ReplayGain tags when trancoding from FLAC

Just tried out opus-tools-0.2, which is now able on Windows to receive FLAC as input.

My input FLAC file has these metadata:

  • regular tags ("artist", "title", etc.)
  • a custom tag (fwiw, it's "place")
  • ReplayTags tags ("track gain", "track peak", "album gain", "album peak")

All tags have been copied, except some ReplayGain ones, namely: "track peak", "album gain", "album peak".

Interestingly enough, the first ReplayGain tag ("track gain") has been copied.

How to modify metadata without re-encoding?

As far as I can tell, the only way to modify metadata with opus tools is with opusenc during encoding? It doesn't support opus files as input, and opusinfo only displays information.

If there really is no official tool for this, I think an equivalent to metaflac or vorbiscomment would be needed in opus tools.

How to organize the union of two opus-files encoded with the same options?

How to organize the union of two opus-files encoded with the same options?

There is a need to merge several audiobook chapters into one opus-file without recoding and use tagging:

CHAPTER###=play time (hh:mm:ss.sss)
CHAPTER###NAME=title "chapters"

How to use opus-tools and opus library for this? So far I have not answered this question.

Allow user to specify payload type for opusrtp extract (or don't filter on PT 120)

(Similar to what was mentioned the other day in issue 25)
I have a sniffer with an rtp stream with opus codec on payload type 114, in opusrtp.c it is hardcoded to 120
#define OPUS_PAYLOAD_TYPE 120
Payload type is dynamic (96-127), so having it set statically to 120 is not really handy.

I managed to get around it by recompiling opusrtp with the payload I needed. It would be nice if there is a parameter you can just pass along to tell opusrtp what payload type to use. Or remove the payload type number filter and expect the user to use wireshark to extract only the relevant audio rtp stream which is then provided to opusrtp.

@giavac

build error with VS2015

when the project is build with VS2015.

error show:
C1083 Cannot open include file: 'ogg/ogg.h': No such file or directory
C1083 Cannot open include file: 'opus.h': No such file or directory

should i do some mannal setting to correct this?

thanks.

Why and how does opusdec decode to original input sample rate?

What is the reasoning for opusenc encoding original input sample rate, and specifically, opusdec decoding to original input sample rate?

How does opusdec know what the original sample rate is, and how does opusdec resample from 48000 kHz Opus to input sample rate?

opusrtp with payload type of 111

rtpdump.opus.zip

opusrtp_out.txt
Hi,

I'm not claiming this is a bug but I would appreciate your guidance/expertise on the following:

I have a pcap of an opus RTP stream (captured from webrtc).

the SDP file for the RTP stream specified the codec as:

rtpmap:111 opus/48000/2

I attempted to use opusrtp to extract the audio from the capture but opusrtp is hard-wired to accept only accept one specific RTP payload type (OPUS_PAYLOAD_TYPE = 120).

I then speculatively tried changing the OPUS_PAYLOAD_TYPE constant definition 111 to see what would happen. What occured next was a fairly sensible looking console output with a rtpdump.opus being created. However, that opus file seems to be potentially garbled (it was not intelligible to opusdec when I tried to extract the audio as a wav).

I have attached the opusrtp console output and the resulting rtpdump.opus

I can also send you the original pcap I passed to opusrtp if that would be useful.

My question is:

  • should I have any expectation that changing the OPUS_PAYLOAD_TYPE constant from 120 to 111 in this case would yield a useful result
  • if yes, can you suggest any reason that the rtpdump.opus doesn't appear to be a playable file. or am I missing something there.

Any help / guidance would be appreciated.

Thanks,

PS - I'm tagging @giavac for his input (as he seems to be the original author of opusrtp ) just in case he is not a follower of issues in this repo. I hope that is ok. but maybe this issue is more of an opus question than an RTP / pcap question?

Release

There is no stable release since 3 years.

Show total samples used to calculate duration in opusinfo

opusinfo currently shows the total playback duration/length. It would also be nice to see the total samples that would be decoded. In the example below, 6.02s * 48,000 yields 288,960 samples, which does not reflect the 297,910 samples that would actually be decoded for that file for that file.

$ opusinfo trimmed.opus
Processing file "trimmed.opus"...

New logical stream (#1, serial: 1c033e62): type opus
Encoded with libopus 1.1
User comments section follows...
  ENCODER=opusenc from opus-tools 0.1.9
  ENCODER_OPTIONS=--hard-cbr --bitrate 64
Opus stream 1:
  Pre-skip: 312
  Playback gain: 0 dB
  Channels: 2
  Original sample rate: 48000 Hz
  Packet duration:   20.0ms (max),   20.0ms (avg),   20.0ms (min)
  Page duration:   1000.0ms (max),  888.6ms (avg),  220.0ms (min)
  Total data length: 51101 bytes (overhead: 2.62%)
  Playback length: 0m:06.206s
  Average bitrate: 65.87 kbit/s, w/o overhead: 64.14 kbit/s (hard-CBR)
Logical stream 1 ended

[opusdec] Extra packets on initial header page; "Seems like they are using ogg_api incorrectly"

This seems to be a lovely inter-repo discussion, and I am the messenger.
This is about opusdec and perm-failing on header errors, or not errors.

https://gitlab.com/axet/android-call-recorder/issues/27#note_49530969

So, related to #22 I have reported the problem to the source, namely android-call-recorder, where Axet responded in the aforementioned link, saying:

Seems like they are using ogg_api incorrectly (it seems they do not skip tag data in header).
But any way - they got header the data, they got all info they need, and they deliberately fail,
no ogg api ask you to FAIL in this circumstances, again maybe it is a TAG section which
force them to fail.

@rillian wrote that the numbers are suspicious ("In addition to the extra packets and unset pre-skip value, 60 ms packet durations probably aren't what you want.") and I'll relay this to Axet but he also provided the source creating the stream:

https://gitlab.com/axet/android-audio-library/blob/master/src/main/java/com/github/axet/audiolibrary/encoders/FormatOPUS_OGG.java

So I try somehow to connect your two sides and figure out whether the java code is wrong, or opusdec is wrong, or both are, or both is correct and we're just cursed. :-)

Encoding from DTS WAV files?

Forgive me if this is the wrong place to raise this issue.

I want to convert a surround sound DTS file directly to opus, but it seems like this isn't possible.

I have a file dts.wav. Using avconv I can see the file format is...

Input #0, dts, from 'dts.wav':
  Duration: 00:01:23.45, start: 0.000000, bitrate: 1411 kb/s
    Stream #0.0: Audio: dca (DTS), 44100 Hz, 5.1, fltp, 1411 kb/s

If I try to convert using opusenc dts.wav out.opus I get the following error:

Error parsing input file: dts.wav

If I convert the wav to a multichannel flac, I can then successfully convert the flac to opus.

Is there any way to convert directly without this intermediary stage?

.lib files for windows

Is there any place where the .lib files required to build the windows tools can be downloaded? I get errors for all of these:

opus.lib
libogg_static.lib
opusfile.lib
opusenc.lib

built opus and libogg_static, to which 'libFLAC_static.lib' started throwing errors.

Is it expected to manually build all of these projects to build opus-tools for windows?

opusdec missing raw endian control

The Opus decoder should be capable of writing RAW output having the same properties the encoder supports to read RAW. Ie: bits/sample, rate, channels, and endianness.

The decoder supports the first three (16 vs 32bit, rate, and stereo), but always writes raw as little-endian.

I need to encode raw big-endian streams and decode to the same format, on both little and big-endian platforms.

opusenc --raw --raw-rate 44100 --raw-endianness 1 input-BE.raw output.opus
opendec --rate 44100 --raw-endianness 1 input.opus output-BE.raw

Thanks for considering this addition.

configure: make libflac really optional

opus-tools can actually be built without flac support, but the default behavior for configure is to raise an error when flac is not detected, why? This should be optional, as in vorbis-tools.
Well, when the user asks for flac AND the detection fails, then an error is due but why halt the build when flac is optional?

visual Studio2015 build opusenc fail

I cloned the opus-tools project from github and compiled it using visual studio2015, but the opusenc module failed to compile. The other two modules succeeded. Here is my error message.

2> libFLAC_static.lib (stream_decoder.obj): find MSIL .netmodule or module compiled with /GL; restarting link using /LTCG; add /LTCG to link command line to improve linker performance
2>LINK : warning LNK4075: Ignore "/INCREMENTAL" (due to the "/LTCG" specification)
2>libogg_static.lib(framing.obj) : warning LNK4075: Ignoring "/EDITANDCONTINUE" (due to the "/OPT:LBR" specification)
2>LINK : warning LNK4098: The default library "LIBCMT" conflicts with the use of other libraries; use /NODEFAULTLIB:library
2>opusenc.lib(opusenc.obj) : error LNK2001: Unresolved external symbol _opus_projection_ambisonics_encoder_create
2>opusenc.lib(opusenc.obj) : error LNK2001: Unresolved external symbol _opus_projection_encode_float
2>opusenc.lib(opusenc.obj) : error LNK2001: Unresolved external symbol _opus_projection_encoder_destroy
2>opusenc.lib(opusenc.obj) : error LNK2001: Unresolved external symbol _opus_projection_encoder_ctl
2>opusenc.lib(opus_header.obj) : error LNK2001: Unresolved external symbol _opus_projection_encoder_ctl
2>Win32\Debug\opusenc.exe : fatal error LNK1120: 4 unresolved external commands
========== All regeneration: 1 success, 1 failure, skip 0 ==========

Please help me to see what caused the problem

WebM Container Support for Opus Tools

How feasible would it be to add official tooling support for WebM Containers? Like Ogg, WebM seems to be a preferred, royalty-free web standard moving forward. Currently, Ogg containers are not supported by Media Source Extensions (MSE), but MSE does support WebM (see w3c/media-source#245). I am currently using third-party tools like ffmpeg to create WebM Opus audio files for use with MSE.

Use Case

Based on my research & experimentation, MSE currently provides the lowest possible latency for Opus playback in browsers with slow connections, allowing audio to be played as soon as the first audio bytes are downloaded. Additionally, MSE offers native platform Opus decoding without needing to use WebAssembly and the Web Audio API to decode and play PCM audio. Would be great to use official Opus tools to achieve this.

Without MSE, native browser playback requires up to 100k to be downloaded (HTTP range requests for start (metadata) and last (duration calculation) bytes). This is problematic for slow internet connections capable of sustainably streaming an Opus file. For example, a 64 bitrate Opus file over a 72 kbps connection yields a 12s playback latency in Chrome and 5s in Firefox:

https://fetch-stream-audio.anthum.com/72kbps/opus/house--64kbs.opus?cacheBust=1

Screen Shot 2019-12-03 at 10 46 03 AM

(more throttled endpoints)

the audio duration changes

I just learned about opus. A simple problem is that I use opusenc to encode a PCM file into opus file, and then use opusdec to decode the opus file into PCM. The difference between the two PCM files is not big. But I use opus_demo repeats the above operation, and the decoded PCM has a few milliseconds less tail than the PCM before encoding。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.