Convert video from .mp4 to .ogg

7

6

I am using ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers . I need to convert a file .mp4, to .ogg format. I am on Mac OS X, and I have tried this so far:

ffmpeg -i sample_mpeg4.mp4 -acodec vorbis -vcodec libtheora -f ogg output.ogv

I am getting: Unknown encoder 'libtheora'

ffmpeg -i sample_mpeg4.mp4 -acodec libvorbis -vcodec --enable-libtheora output.ogv

I am getting: Unknown encoder '--enable-libtheora'

ffmpeg -i sample_mpeg4.mp4 -acodec libvorbis -vcodec libtheora -f ogv output.ogv

I am getting:

[NULL @ 0x7f81bb00f800] Requested output format 'ogv' is not a suitable output format
output.ogv: Invalid argument

ffmpegtheora is not an option as it can not be install on the server.

Unknown

Posted 2013-01-09T13:40:20.770

Reputation: 81

What about ffmpeg -i file.mp4 file.ogg? This works on my Debian wheezy box, not sure about Mac OS X. – user49740 – 2013-01-09T13:48:01.920

Nope. It does not work – Unknown – 2013-01-09T13:54:44.560

Then it's an OSX-specific problem. You most probably don't have the required codecs. – user49740 – 2013-01-09T13:56:45.113

1In the future, when asking FFmpeg questions, please include the full, uncut command output, not just the error messages you think are relevant. – slhck – 2013-01-09T14:02:51.763

Answers

10

Your FFmpeg version is missing the required encoders, libtheora for Theora video and libvorbis for Vorbis audio.

You can only add these encoders by either

  • compiling them with FFmpeg, or
  • installing an executable that bundles them already.

For you the easiest choice would be to download a static version from the FFmpeg download page. They all come with libtheora and libvorbis, regardless of the operating system they were built for.

What you then need to do is extract the download archive and simply run the ffmpeg binary that was included. The correct syntax would be:

ffmpeg -i in.mp4 -c:v libtheora -c:a libvorbis out.ogv

If you want to change the quality for either audio or video, you can change the bit rate, e.g. with -b:v 1M or -b:a 192k. Play with those values and use a higher or lower bitrate depending on the quality or file size constraints you have.

You can also use VBR (constant quality) with -q:v, where values range from 0 to 10 (higher is better), with 7 being recommended. The audio quality can be set with -q:a, again with values from 0 to 10, where 4 is recommended and corresponds to roughly 128 kBit/s.

Note that --enable-libtheora is a configuration option and doesn't work when calling ffmpeg.

slhck

Posted 2013-01-09T13:40:20.770

Reputation: 182 472

9

Use Homebrew package manager

Install Homebrew in command line

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Install ffmpeg with libtheora support

$ brew install ffmpeg --with-theora --with-libvorbis

Other options are listed here

$ brew options ffmpeg

Hope it helps others or future me ;)

elmariofredo

Posted 2013-01-09T13:40:20.770

Reputation: 91

5You might also need --with-libvorbis, like this: brew install ffmpeg --with-theora --with-libvorbis – Adam Taylor – 2016-03-01T17:44:36.107

1You can also use reinstall brew reinstall ffmpeg --with-theora --with-libvorbis – pixelearth – 2018-06-28T21:59:02.680

0

--enable-libtheora should be used when building ffmpeg from source, not while trying to run the program. You should try rebuilding ffmpeg (using the latest source of course ) and adding support for libtheora during configure (./configure --enable-libtheora etc....)

If you need help on building from source, there's lots of stuff on google, but it boils down (for you) enabling the libraries you need, you can see here and _http://jungels.net/articles/ffmpeg-howto.html for starters.

MDMoore313

Posted 2013-01-09T13:40:20.770

Reputation: 4 874

There's usually no need to build from source, as it can be quite a chore on OS X. Package managers such as Homebrew simplify this task, but the OP may as well just use a static build from the FFmpeg download page. – slhck – 2013-01-09T14:15:57.963