ffmpeg encoders


i need help with ffmpeg on openSUSE 42.1. With “ffmpeg -codecs” there are a few video encoders, but most of them only have the decoder available. What i want to do is converting videos into VP8 or VP9 with opus as the audio codec. I didn’t find anything in the wiki.
How do i install the encoders of them?


first off the ffmpeg from the oss repo is extremely limited but it should output to vp8/9 you should get it from packman
then you need to do something like

ffmpeg -i infile.webm -vcodec libvpx-vp9 -crf 20 -acodec libvorbis -abitrate 128k  -f matroska outfile.webm

webm is mkv with a different extension and a limited codec (only vp8/9 for video and vorbis for audio)
as I said the oss version of ffmpeg will output vpx compression but it will only accept uncompressed or vpx video you need packman’s version for a full working ffmpeg
do you have packman,post your repo list

zypper lr -d

sorry didn’t notice you asked about opus not vorbis, libopus is available in packman’s build, a change from vorbis to opus is simple, just change the encoding library to libopus
so an encode would be

ffmpeg -i infile.webm -vcodec libvpx-vp9 -crf 20 -acodec libopus -abitrate 128k  -f matroska outfile.webm

you can tweak the bit rate or use vbr instead, check out the ffmpeg codec docs

Thanks! I installed ffmpeg from packman now, but there are still no vp8/vp9 or opus encoders. Only the decoders are installed (libopus0 is installed).
I checked the available encoders with “ffmpeg -encoders”. How do i install or enable the encoders?

I’ve never really tested vp9 encoders afaik they should be there, maybe you need to do a dup with packman
tell us your repo list

zypper lr -d

I’ll find a small video and try to convert it to vp9/opus

libvpx should do it but not sure it shows in list as webM or vp8/vp9 probaly should check the ffmpeg docs for more info

I just converted a flv file that had h264 video + aac audio to webm with vp9 video and opus audio, I did a simple convert

ffmpeg -i my_file.flv -vcodec libvpx-vp9 -acodec libopus -f matroska out_video.webm

if you run ffmpeg without any switch you’ll see the supported formats

me@linux:~/Documents> ffmpeg
ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (SUSE Linux)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags=’-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g’ --optflags=’-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g’ --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-runtime-cpudetect --enable-gpl --disable-openssl --enable-avresample --enable-libcdio --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libfreetype --enable-libgsm --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-pic --enable-pthreads --enable-vaapi --enable-vdpau --disable-decoder=dca --enable-libdcadec --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libtwolame --enable-libvo-aacenc --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [infile options] -i infile]… {[outfile options] outfile}…

Use -h to get full help or, even better, run ‘man ffmpeg’

if you’re new to ffmpeg maybe you can try ffmpegyag

zypper in ffmpegyag

it doesn’t have libopus and libx265 as an option but you can enter those by hand, anyway my webm vp9+opus file plays fine in vlc/mplayer

When i just type “ffmpeg” i get about 3 pages (on a full hd screen) of parameters, “–enable-libopus” and “–enable-libvpx” is also listed. And they are listed in “ffmpeg -codecs” but only as decoders. I’m sorry, just a bit of a new situation as other distribution enable the encoders by default.
This is the output from “zypper lr -d”

#  | Alias                     | Name                                    | Aktiviert | GPG-Überprüfung | Aktualisieren | Priorität | Typ    | URI                                                                     | Dienst
 1 | openSUSE-42.1-0           | openSUSE-42.1-0                         | Ja        | (r ) Ja         | Ja            |   99      | yast2  | http://download.opensuse.org/distribution/leap/42.1/repo/oss/           |       
 2 | packman                   | packman                                 | Ja        | (r ) Ja         | Ja            |   99      | rpm-md | http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_42.1/      |       
 3 | repo-debug                | openSUSE-Leap-42.1-Debug                | Nein      | ----            | Ja            |   99      | NONE   | http://download.opensuse.org/debug/distribution/leap/42.1/repo/oss/     |       
 4 | repo-debug-non-oss        | openSUSE-Leap-42.1-Debug-Non-Oss        | Nein      | ----            | Ja            |   99      | NONE   | http://download.opensuse.org/debug/distribution/leap/42.1/repo/non-oss/ |       
 5 | repo-debug-update         | openSUSE-Leap-42.1-Update-Debug         | Nein      | ----            | Ja            |   99      | NONE   | http://download.opensuse.org/debug/update/leap/42.1/oss                 |       
 6 | repo-debug-update-non-oss | openSUSE-Leap-42.1-Update-Debug-Non-Oss | Nein      | ----            | Ja            |   99      | NONE   | http://download.opensuse.org/debug/update/leap/42.1/non-oss/            |       
 7 | repo-non-oss              | openSUSE-Leap-42.1-Non-Oss              | Nein      | ----            | Ja            |   99      | NONE   | http://download.opensuse.org/distribution/leap/42.1/repo/non-oss/       |       
 8 | repo-source               | openSUSE-Leap-42.1-Source               | Nein      | ----            | Ja            |   99      | NONE   | http://download.opensuse.org/source/distribution/leap/42.1/repo/oss/    |       
 9 | repo-update               | openSUSE-Leap-42.1-Update               | Ja        | (r ) Ja         | Ja            |   99      | rpm-md | http://download.opensuse.org/update/leap/42.1/oss/                      |       
10 | repo-update-non-oss       | openSUSE-Leap-42.1-Update-Non-Oss       | Ja        | (r ) Ja         | Ja            |   99      | rpm-md | http://download.opensuse.org/update/leap/42.1/non-oss/  

I already tried to convert a video like you described. But ffmpeg returns “Unknown encoder ‘libvpx-vp9’”. I would really like to stay to the cli, because i wrote a bash script (that was on Fedora/Rpm Fusion) that converts videos and are doing some many things too (like getting the audio information via ffmpeg and adjust the volume if it’s too loud). But of course i’ll try ffmpegyag.
Of course i didn’t use that script yet on openSUSE, as it should first work with a single line like yours.


zypper dup --from 2

Thanks, it worked!