Entries tagged with ogg

Overview:

FFmpeg's built-in Vorbis encoder produces low enough quality output to
be considered broken. This encoder is used by default in the majority
of FFmpeg builds, and will produce .ogv and WebM videos with low to
unusably poor audio quality.

This alert is intended for all users of FFmpeg (via the command line
or GUI wrappers) and all application developers that make use of the
FFmpeg command line tool. Application developers that use the FFmpeg
libraries should also take care that the libavcodec built-in Vorbis
encoder library is not used by accident.

Scope:

All past and present builds of FFmpeg and libavcodec up to but not
including the upcoming 0.6 release. Default builds of the upcoming
FFmpeg 0.6 release will not use the built-in encoder by default, but
it will still be possible to accidentally use or restore the built-in
encoder to default status during the FFmpeg build. It should be
assumed that any build of FFmpeg and any application using FFmpeg
could be producing videos with substandard Vorbis audio unless the
FFmpeg build and usage is verified to be using system Vorbis
libraries, such as those provided by Xiph.Org or aoTuV.

Workaround / Fix:

FFmpeg can be forced to use the external/system libVorbis library by
passing:

-acodec libvorbis

as part of the FFmpeg command line.

Note that passing '-acodec vorbis' is incorrect and requests the
low-quality built-in FFmpeg-internal Vorbis encoder. Also, FFmpeg may
be built without libvorbis support, meaning that many FFmpeg builds
only have the internal encoder available. In this case, requesting
'-acodec libvorbis' will fail with the error 'Unknown encoder
'libvorbis''.

FFmpeg can be built with working libvorbis support and the internal
Vorbis encoder disabled as follows:

Such a build completely removes the internal Vorbis encoder from
libavcodec, eliminating the possibility of accidental use on the
command line or in libavcodec-based applications.

Verification:

Use of a good Vorbis encoder in .ogg, .oga, .ogv and WebM files may be
verified as follows. This test will work on any Ogg or WebM file to
verify the encoder that produced the audio. Note that 'Vorbis' is
case-sensitive:

strings file_to_be_checked | grep Vorbis

A file that was encoded using a good encoder will output a line
containing 'Xiph.Org libVorbis' or 'AoTuV', such as:

The latest action-packed, graph- and demo-clip-stuffed Theora
project update page (demo 9) is now up for all and sundry!
Catch up on what's gone into the new Theora encoder 'Ptalarbvorm'
over the last few months. It also instructs how to pronounce
'Ptalarbvorm'.

Ptalarbvorm is not a finished release encoder yet, though I've
personally been using it in production for a few months. Pace on
improvements hasn't slowed down-- the subjective psychovisual
work being done by Tim Terriberry and Greg Maxwell has at least
doubled-again on the improvments made by Thusnelda, and they're
not anywhere near done yet.

RANDOM GRAPH:

You'll just have to read the project update to see what that is all about :-)

The demo covers what's already in Ptalarbvorm, previews of
what's next to land, and a sneak peek of 1.3 once Ptalarbvorm is
finished.

Mans Rullgard has written two long rants about the Ogg container in
the past few years. One made it to Slashdot apparently based on the drama potential alone. If
you don't know what I'm talking about below, don't worry about it,
tl;dr.

I'd not originally intended to respond to open trolling. The
continued urging of many individuals has convinced me it's important
to rebut in some public form. Earnest falsehoods left unchallenged
risk being accepted as fact.

Aside from bugfixes, the major story here is the first wide release of all the surround hacking I've been doing the past two months. Previous demo pages (one and two) had documented my progress till now; there's actually one more coming that I've just started on.

In addition to that, we also tagged on a release of libogg with a new default page spill rule that reduces container overhead for higher bitrate streams like video. The change is simple, but it's a reduction in bitrate for free so why not. Applications don't have to do anything, just drop in the new lib. In addition to demo pages and blogging, I've also begun a comprehensive expansion of the Ogg documentation (the very beginnings of which are in the release-- not much yet).

I know everyone has already seen this (there's certainly been wide press coverage), but it's worth repeating... Opera 10.5 is out and is the first shipped version with HTML5, <video> and Ogg support out of the box. It's a long time coming, the first Ogg-enabled betas were in 2007.

It's amazing how software sidetracks can plow through years of time. I'm finally getting back to Vorbis (and other audio development) after a minor two year video distraction that saw the completion of a new experimantal Theora encoder (Thusnelda) last year, and the beginning of the next experimental Theora encoder which Tim has named Ptalarbvorm. Ptalarbvorm is already showing further large improvements over Thusnelda (honestly, I think he's already doubled again on Thusnelda).

But this post is about Vorbis.

One thing on the original Vorbis bullet list was surround encoding. Vorbis was always surround capable and the software is happy to encode as many channels as you like, but once you're past stereo, everything is encoded as entirely discrete channels. This hasn't been so bad really; despite discrete channels, Vorbis's coding efficiency compares favorably to other surround-capable formats. That said, Vorbis can do better.

When beginning surround optimization work on Vorbis, I found the encoder handled remapping the channel order of input formats, but it didn't always do it properly (FLAC and some WAV inputs were frotzed). I also found that ogg123 needed updating to handle output order. These improvements will be released in vorbis-tools 1.4.0 sometime soon.

The hard part of the tool updates turned out to be libao, which both had no concept of channel ordering, and had also bitrotted substantially while maintainerless. The idea had been that Lennart Poettering's SydneyAudio was going to replace libao so there was no sense continuing to develop libao. We'd just use libao while we waited and not put any more resources into it. Unfortunately, Lennart has been entirely occupied fighting his PulseAudio battles, and this is frankly a more important use of his time. SydneyAudio is no closer to completion than it was a few years ago. We can't continue to wait for it.

So, I'm announcing the resumption of active development and maintenance of libao until such time as there's something better to replace it.

I've made up a surround demo page (like the ones I made during Thusnelda development) with more details on vorbis-tools, libao, and Vorbis's in-progress surround hacking. It goes into alot more detail about Vorbis's surround and channel coupling system with diagrams and samples. I hope folks like it!