ffmpeg unable to find encoder libvpx
Asked Answered
S

4

52

when i run

ffmpeg -y -i test.mov -threads 8 -f webm -aspect 16:9 -vcodec libvpx -deinterlace -g 120 -level 216 -profile 0 -qmax 42 -qmin 10 -rc_buf_aggressivity 0.95 -vb 2M -acodec libvorbis -aq 90 -ac 2 OUTPUT_FILE.webm

it returns an error saying Unknown encoder 'libvpx'

I installed libvpx, libvorbis, libogg, and ffmpeg all via macports

Shortbread answered 12/6, 2012 at 19:23 Comment(2)
Run ffmpeg -v and check if it was built with --enable-libvpx. Most likely you need a different build or to compile it yourself.Uncut
oh, there is not libvpx, is there a macport build with libvpx, etc?Shortbread
T
129

Your configuration of macports was not built with libvpx. Try uninstalling ffmpeg and using Homebrew to install the package instead of macports:

brew install ffmpeg --with-libvpx

or

brew reinstall ffmpeg --with-libvpx

Then your command should work.

Tho answered 29/11, 2012 at 15:42 Comment(3)
I'm not sure why, but when I reinstall with only libvpx and libvorbis, I still got webm errors. However when I did all of these, it worked. Not sure which flag was the fix. brew reinstall ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-speex --with-theora --with-toolsLaicize
--with-libvorbis is also needed. webm requires vorbis for audio compression. --with-theora can also be added to compiler options if you are having experimental encoder warnings from ffmpeg.Streptothricin
Not necessary with new ffmpeg in brew anymore! Just upgrade it: brew upgrade ffmpegBoraginaceous
S
8

I'm not sure how and if it's possible to change the default configuration on Macports. Anyway, you can do it the manual way.

Open terminal and cd to your preferred directory. Before installing, check if, where and what version of ffmpeg you have install. Use which ffmpeg, then port uninstall ffmpeg and then which ffmpeg again to verify ffmpeg was uninstall properly.

Download the source code from:

git clone https://github.com/FFmpeg/FFmpeg ffmpeg

cd to the ffmpeg directory

cd ffmpeg

configure and make with your configuration, use "./configure --help" to get information regarding possible configuration

./configure --extra-cflags=-I/opt/local/include --extra-ldflags=-L/opt/local/lib --enable-gpl --enable-version3 --enable-nonfree --enable-libvpx --enable-libvorbis

I recommend adding the extra c/ld flags because /opt/local/ is the default macport install directory.

Make, install ffmpeg

make
sudo make install

There are a lot of fallbacks in these steps, ask in the comments if you have any issue.

Switzerland answered 14/6, 2012 at 5:21 Comment(4)
this is not a rant and +1 for your answer. But nowadays use homebrew. It makes your life so much easier!Samson
true. I use homebrew myself for local development, yet for my production / deployment chef scripts, I still compile ffmpeg manually.Switzerland
If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the [email protected] mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "config.log" produced by configure as this will help solve the problem.Featly
make sense. this answer was given 4 years ago, follow ./configure --help for compiling assistance or use a package builder like homebrewSwitzerland
C
1

Due to all the dependencies building ffmpeg from source is a nightmare on OS X. It will take you days to get it to build properly.

Don't bother.

Instead just download the static binary from https://www.ffmpeg.org/download.html and copy it into /usr/local/bin

Copse answered 24/2, 2015 at 4:50 Comment(2)
Be sure to hover over the Apple logo to have the page show the OSX downloads (I didn't know this when I fist went on the page).Butterscotch
Builds seamlessly through homebrew with options --with-libvpx and --with-libvorbis. Took about 5 minutes.Silver
D
0

While it is suggested by some people that you can simply use the static binaries from ffmpeg.org, it may be worth noting that behaviors in certain conditions static binaries can have small differences compared to shared library binaries.

For example, on MacOS, the shared ffplay from MacPorts would use the monitor color profile (if you did not explicitly set one, it tries to use the color primaries and white point from EDID) to correct the colors, clamping them when needed. But the static one from evermeet.cx does NOT, which would lead to slightly off colors, making you think the video colors are wrong when they are not.

Deform answered 6/10, 2023 at 4:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.