libopus support.

Website, builds, or other suggestions.
bat999
Posts: 49
Joined: Wed Sep 19, 2012 8:07 pm

libopus support.

Post by bat999 » Wed Sep 19, 2012 8:19 pm

Hi
Opus decoder is available for FFmpeg.
Maybe you can make Zeranoe builds with --enable-libopus.
Though there probably isn't much demand yet. :P

With Linux compiled FFmpeg I can run commands like this:-

Code: Select all

ffplay http://icecast-beta.timlradio.co.uk:8000/ar96.opus
Opus test streams from here ---> http://www.absoluteradio.co.uk/listen/labs.html#opus

Opus information here ---> http://opus-codec.org/

Code: Select all

ffmpeg -decoders | grep -i opus
A....D libopus Opus (codec opus)

bat999
Posts: 49
Joined: Wed Sep 19, 2012 8:07 pm

Re: libopus support.

Post by bat999 » Thu Oct 04, 2012 10:38 pm

Hi
Opus encoder has been added too. 8-)

Code: Select all

ffmpeg -encoders | grep -i opus

Code: Select all

A..... libopus Opus (codec opus)

Code: Select all

$ ffmpeg -i foo.wav -c:a libopus -b:a 64k foo.opus

Code: Select all

@ubuntu:~$ mediainfo foo.opus
General
Complete name        : foo.opus
Format               : OGG
File size            : 464 KiB
Duration             : 1mn 0s
Overall bit rate     : 62.8 Kbps
Writing application  : Lavf54.29.105
 
Audio
ID                   : 1250288664 (0x4A85E418)
Format               : Opus
Duration             : 1mn 0s
Channel(s)           : 2 channels
Channel positions    : Front: L R
Sampling rate        : 48.0 KHz
Compression mode     : Lossy
Writing library      : Lavf54.29.105

rogerdpack
Posts: 1876
Joined: Fri Aug 05, 2011 9:56 pm

Re: libopus support.

Post by rogerdpack » Mon Oct 08, 2012 6:59 pm

It appears that it cross compiles well:
see if
http://rogerdpack.t28.net/incoming/ffmp ... 41.opus.7z works with the encoder that would be interesting...

bat999
Posts: 49
Joined: Wed Sep 19, 2012 8:07 pm

Re: libopus support.

Post by bat999 » Mon Oct 08, 2012 7:31 pm

rogerdpack wrote: see if
http://rogerdpack.t28.net/incoming/ffmp ... 41.opus.7z works with the encoder that would be interesting...
Yes, tested OK with 32-bit Windows XP. :)
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator\Desktop>ffmpeg -i foo.wav -c:a libopus -
b:a 64k foo.opus
ffmpeg version N-45163-gd7a4739 Copyright (c) 2000-2012 the FFmpeg developers
built on Oct 8 2012 12:30:30 with gcc 4.7.1 (GCC)
configuration: --enable-memalign-hack --arch=x86 --enable-gpl --enable-libx264
--enable-avisynth --enable-libxvid --target-os=mingw32 --cross-prefix=/tmp/ffmp
eg-windows-build-helpers/sandbox/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-conf
ig=pkg-config --enable-libmp3lame --enable-version3 --enable-libvo-aacenc --enab
le-libvpx --extra-libs=-lws2_32 --extra-libs=-lpthread --enable-zlib --extra-lib
s=-lwinmm --extra-libs=-lgdi32 --enable-librtmp --enable-libvorbis --enable-libt
heora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --e
nable-libfreetype --disable-optimizations --enable-mmx --disable-postproc --enab
le-fontconfig --enable-libass --enable-libutvideo --enable-libopus --disable-w32
threads --extra-cflags=-DPTW32_STATIC_LIB --enable-runtime-cpudetect
libavutil 51. 73.102 / 51. 73.102
libavcodec 54. 65.100 / 54. 65.100
libavformat 54. 30.100 / 54. 30.100
libavdevice 54. 3.100 / 54. 3.100
libavfilter 3. 19.102 / 3. 19.102
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 16.100 / 0. 16.100
[wav @ 022393E0] max_analyze_duration 5000000 reached at 5015510
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'foo.wav':
Duration: 00:01:00.41, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16
, 1411 kb/s
Output #0, ogg, to 'foo.opus':
Metadata:
encoder : Lavf54.30.100
Stream #0:0: Audio: opus, 48000 Hz, stereo, s16, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le -> libopus)
Press [q] to stop, [?] for help
size= 464kB time=00:01:00.42 bitrate= 62.8kbits/s
video:0kB audio:457kB subtitle:0 global headers:0kB muxing overhead 1.453547%

BiDouiLle
Posts: 58
Joined: Wed Oct 17, 2012 7:45 am
Location: Corsica

Re: libopus support.

Post by BiDouiLle » Wed Oct 17, 2012 8:48 am

It's a really good idea.

Few args to support "enable-libopus" :
  • - CELT is stated as obsolete by Xiph and has been merged into Opus
  • - Opus has been standardized by the Internet Engineering Task Force (IETF) as RFC 6716
Opus support should not be ignored regarding FFMPEG's position about HTML5.

That's my point of view as an IT engineer using FFMPEG Zeranoe's builds.

:ugeek:

Regards.

User avatar
Zeranoe
Site Admin
Posts: 702
Joined: Sat May 07, 2011 7:12 pm
Contact:

Re: libopus support.

Post by Zeranoe » Wed Oct 17, 2012 2:55 pm

BiDouiLle wrote:It's a really good idea.

Few args to support "enable-libopus" :
  • - CELT is stated as obsolete by Xiph and has been merged into Opus
  • - Opus has been standardized by the Internet Engineering Task Force (IETF) as RFC 6716
Opus support should not be ignored regarding FFMPEG's position about HTML5.

That's my point of view as an IT engineer using FFMPEG Zeranoe's builds.
Excellent first post BiDouiLle.

I will put this encoder on my todo list, I might even get to it tonight.

Thanks for your input and well referenced/formatted post.

User avatar
Zeranoe
Site Admin
Posts: 702
Joined: Sat May 07, 2011 7:12 pm
Contact:

Re: libopus support.

Post by Zeranoe » Sat Oct 20, 2012 4:30 am

Opus has been added to the builds and CELT support has been removed.

Thank you again for the well informed post.

LithosZA
Posts: 14
Joined: Sun Apr 14, 2013 4:32 pm

Re: libopus support.

Post by LithosZA » Sat Jul 13, 2013 9:20 am

Some of the fixes in libopus 1.1beta have been backported to 1.0.3: http://www.opus-codec.org/downloads/
We could update libopus to 1.0.3 while we wait for the new 1.1 improvements: http://people.xiph.org/~xiphmont/demo/opus/demo3.shtml

Ajaja
Posts: 69
Joined: Fri Mar 08, 2013 2:00 pm

Re: libopus support.

Post by Ajaja » Sat Jul 13, 2013 10:27 am

http://people.xiph.org/~xiphmont/demo/opus/demo3.shtml
Unconstrained VBR
Previous Opus encoders offered only CBR and ABR with a short time window. As of 1.1, the encoder implements true unconstrained VBR. When using VBR, the bitrate option selects a VBR mode that hits the approximate requested bitrate for most samples (exactly the same as in Vorbis). The encoder has the freedom to use more or fewer bits at any time as it sees fit in order to maintain consistent quality.

Temporal VBR
1.1 also adds temporal VBR, an accidental discovery from a bug in an earlier pre-release. Temporal VBR is new heuristic that adds bits to loud frames and steals them from quiet frames. This runs counter to classic psychoacoustics; critical band energies matter, not the broadband frame energy. In addition, TVBR does not appear to be exploiting temporal postecho effects.
I think ffmpeg may need some patches to utilize this functionality.

LithosZA
Posts: 14
Joined: Sun Apr 14, 2013 4:32 pm

Re: libopus support.

Post by LithosZA » Sun Jul 14, 2013 5:15 am

I think ffmpeg may need some patches to utilize this functionality.
Not for those options. The choice between CBR/CVBR/VBR has always been available in libopus, but the VBR setting was more constrained and acted more like CVBR:
Most libopus options are modeled after the opusenc utility from opus-tools. The following is an option mapping chart describing options supported by the libopus wrapper, and their opusenc-equivalent in parentheses.

‘b (bitrate)’

Set the bit rate in bits/s. FFmpeg’s ‘b’ option is expressed in bits/s, while opusenc’s ‘bitrate’ in kilobits/s.
‘vbr (vbr, hard-cbr, and cvbr)’

Set VBR mode. The FFmpeg ‘vbr’ option has the following valid arguments, with the their opusenc equivalent options in parentheses:

‘off (hard-cbr)’

Use constant bit rate encoding.
‘on (vbr)’

Use variable bit rate encoding (the default).
‘constrained (cvbr)’

Use constrained variable bit rate encoding.

‘compression_level (comp)’

Set encoding algorithm complexity. Valid options are integers in the 0-10 range. 0 gives the fastest encodes but lower quality, while 10 gives the highest quality but slowest encoding. The default is 10.
‘frame_duration (framesize)’

Set maximum frame size, or duration of a frame in milliseconds. The argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller frame sizes achieve lower latency but less quality at a given bitrate. Sizes greater than 20ms are only interesting at fairly low bitrates. The default of FFmpeg is 10ms, but is 20ms in opusenc.
‘packet_loss (expect-loss)’

Set expected packet loss percentage. The default is 0.
‘application (N.A.)’

Set intended application type. Valid options are listed below:

‘voip’

Favor improved speech intelligibility.
‘audio’

Favor faithfulness to the input (the default).
‘lowdelay’

Restrict to only the lowest delay modes.

‘cutoff (N.A.)’

Set cutoff bandwidth in Hz. The argument must be exactly one of the following: 4000, 6000, 8000, 12000, or 20000, corresponding to narrowband, mediumband, wideband, super wideband, and fullband respectively. The default is 0 (cutoff disabled).
The temporal VBR is something that the encoder automatically enables for bitrates <= 64Kbps. The only thing that I don't think ffmpeg uses is the surround API changes in libopus.

Post Reply