VBR Encoding with libopus

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

VBR Encoding with libopus

Werner Robitza
libopus lets us supply -vbr with the values "off", "on" and "constrained".
In the latter two modes, how does one choose the quality level?

-q:a does not seem to have any effect, and Opus falls back to 96 kBit/s.
Without any option other than -vbr on, it also uses CBR encoding.

Furthermore, the source code (
https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/libopusenc.c)
mentions a "compression_level" option, but how can I set this as a user?

-----------
ffmpeg -i in.mp4 -c:a libopus -vn -vbr on out.opus
ffmpeg version 1.1.2 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb  8 2013 22:55:29 with Apple LLVM version 4.2
(clang-425.0.24) (based on LLVM 3.2svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/1.1.2 --enable-shared
--enable-pthreads --enable-gpl --enable-version3 --enable-nonfree
--enable-hardcoded-tables --enable-avresample --cc=cc --host-cflags=
--host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame
--enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libvo-aacenc --enable-ffplay --enable-libfdk-aac --enable-libopus
--enable-libopenjpeg
--extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1/include/openjpeg-1.5 '
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 86.100 / 54. 86.100
  libavformat    54. 59.106 / 54. 59.106
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 32.100 /  3. 32.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2012-01-08 11:16:19
    encoder         : Lavf53.24.0
  Duration: 00:03:31.58, start: 0.000000, bitrate: 2359 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1280x720 [SAR 1:1 DAR 16:9], 2229 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Metadata:
      creation_time   : 2012-01-08 11:16:19
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo,
fltp, 125 kb/s
    Metadata:
      creation_time   : 2012-01-08 11:16:19
      handler_name    : SoundHandler
[libopus @ 0x7f8eb383a000] No bit rate set. Defaulting to 96000 bps.
Output #0, ogg, to 'out.opus':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.59.106
    Stream #0:0(eng): Audio: opus, 48000 Hz, stereo, flt, 96 kb/s
    Metadata:
      creation_time   : 2012-01-08 11:16:19
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:1 -> #0:0 (aac -> libopus)
Press [q] to stop, [?] for help
size=    2464kB time=00:03:31.59 bitrate=  95.4kbits/s
video:0kB audio:2441kB subtitle:0 global headers:0kB muxing overhead
0.943813%
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VBR Encoding with libopus

James Darnley
On 2013-02-10 22:40, Werner Robitza wrote:
> libopus lets us supply -vbr with the values "off", "on" and "constrained".
> In the latter two modes, how does one choose the quality level?
>
> -q:a does not seem to have any effect, and Opus falls back to 96 kBit/s.
> Without any option other than -vbr on, it also uses CBR encoding.

Perhaps nobody has added that yet.  I certainly can't see anything like
what is used with libmp3lame or libvorbis.

> Furthermore, the source code (
> https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/libopusenc.c)
> mentions a "compression_level" option, but how can I set this as a user?

-compression_level X where X is between 0 and 10 (inclusive)


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

signature.asc (564 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VBR Encoding with libopus

Werner Robitza
>
> Perhaps nobody has added that yet.  I certainly can't see anything like
> what is used with libmp3lame or libvorbis.
>

That makes me wonder why the option was included (even in a stable release)
if it doesn't do anything :)


> > Furthermore, the source code (
> > https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/libopusenc.c)
> > mentions a "compression_level" option, but how can I set this as a user?
>
> -compression_level X where X is between 0 and 10 (inclusive)
>

Thanks. Should've mentioned I already tried that—this option unfortunately
has no effect. I get "No bit rate set. Defaulting to 96000 bps."
The simple explanation would be that there's no interface yet (as indicated
by "ffmpeg -h full"), but maybe a dev can confirm this.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VBR Encoding with libopus

Liam Condron-Farnos
The impression I have - mostly from the opusenc man page - is that opusenc
(and therefore libopus) doesn't have a VBR quality-targeting mode in the
same way that libmp3lame or libvorbis do.

I mean that it doesn't work the same way: with libopus, you simply provide
a target bit rate, and the encoder tries to use that as the average bit
rate. It's confusing because you normally only supply a bit rate for the
CBR mode of a given encoder, but libopus just works differently, I think.

opusenc man page:
https://mf4.xiph.org/jenkins/view/opus/job/opus-tools/ws/man/opusenc.html
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VBR Encoding with libopus

Werner Robitza
> The impression I have - mostly from the opusenc man page - is that opusenc
> (and therefore libopus) doesn't have a VBR quality-targeting mode in the
> same way that libmp3lame or libvorbis do.
>

Interesting. Now that you mention it, there's really no setting for this
other than enabling VBR.


> I mean that it doesn't work the same way: with libopus, you simply provide
> a target bit rate, and the encoder tries to use that as the average bit
> rate. It's confusing because you normally only supply a bit rate for the
> CBR mode of a given encoder, but libopus just works differently, I think.
>

I tried encoding with "-b:a 128k" and got different average bit rates with
the VBR option set to "off", "on" and "constrained", respectively.
Will probably have to do a little more testing.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Loading...