6

I want to ask if ffmpeg supports VP9 encoding, and if not: how can I encode VP9 videos? I try using the command:

./ffmpeg-vp9 -y -i /home/mc/test.mkv -t 00:00:30 -c:v libvpx-vp9 -strict -2 -quality good -b:v 600k -speed 16 -rc_lookahead 25 -pass 1 2.webm

but it shows an error in splitting the command appeared (for vp9). This is the output of ffmpeg -codecs | grep vpx:

 ./ffmpeg -codecs|grep vpx
ffmpeg version N-51352-g81e85bc Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 27 2013 19:22:53 with gcc 4.8.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 22.101 / 52. 22.101
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  0.100 / 55.  0.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 48.105 /  3. 48.105
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
 DEV.L. vp8                  On2 VP8 (decoders: vp8 libvpx ) (encoders: libvpx )

I tried to use vpxenc but i don't know the meaning of its parameters exactly.

Thanks in advance.

1
  • 2
    out of curiosity, why on earth vp9? :-) Commented May 20, 2013 at 20:18

3 Answers 3

6

Basically ffmpeg supports VP9 encoding and decoding. It looks like your build of libvpx doesn't support VP9. For VP9 support you must use the experimental branch:

$ git clone -b experimental http://git.chromium.org/webm/libvpx.git
$ cd libvpx
$ ./configure --enable-vp9 --enable-shared
$ make && make install

This should enable VP9 for ffmpeg, which you have to compile as usual, with the --enable-libvpx configuration option.

6
  • 1
    Thank you for your answer, but i want to ask you if the process of encoding is too long?? Commented May 26, 2013 at 9:06
  • @slhck: I want to ask you please, i tried to write ./ffmpeg -vp9 -y -i 2.mp4 -t 00:00:30 -c:v libvpx-vp9 -strict -2 -quality good -b:v 600k -speed 16 -rc_lookahead 25 -an -f matroska 2.vp9 . But when i run it an error appeared : can't open input file. Why this error appeared??Please Commented May 26, 2013 at 12:51
  • @Computer_Engineer -vp9 is not a valid ffmpeg option. Also, -f matroska forces a Matroska container while you use a .vp9 extension. You should use .webm instead and remove the -f matroska. Running ffmpeg -i input.mp4 -c:v libvpx-vp9 … output.webm (including the remaining options) should do the trick.
    – slhck
    Commented May 26, 2013 at 12:52
  • @slhck: The error was displayed as :Could not find option 'vp9' in any of the FFmpeg subsystems (codec, format, scaler, resampler contexts) Unrecognized option 'vp9'. Error splitting the argument list: Option not found.....Please i want an answer..Thank you very much for your response. Commented May 26, 2013 at 13:02
  • The could not find option 'vp9' means it couldn't find the -vp9 option which doesn't exist as slhck previously stated. Commented Aug 19, 2013 at 23:52
2

Regarding OP's comment about speed. Use two pass encoding. It is significantly faster than single pass and also the image quality is noticeably better.

With my version of ffmpeg,

$ ffmpeg -version
ffmpeg version 2.3.3 Copyright (c) 2000-2014 the FFmpeg developers

the command I am using is

ffmpeg -y -i input.mkv -c:v libvpx-vp9 -b:v 2000k -pass 1 -c:a opus -b:a 64k -f webm /dev/null
ffmpeg    -i input.mkv -c:v libvpx-vp9 -b:v 2000k -pass 2 -c:a opus -b:a 64k -f webm output.webm

Single pass is/was broken, according to http://wiki.webmproject.org/vp9/known-issues

2
  • 1
    Why do you use /dev/null in the first pass? I don't see how information from the first pass is preserved. Does it change the source file?
    – harm
    Commented Apr 10, 2015 at 21:49
  • 2
    @harm FFmpeg creates a file called ffmpeg2pass-0.log in the current directory.
    – user7610
    Commented Apr 11, 2015 at 16:31
1

FFMPEG does support VP9 as long as the linked libvpx was compiled with VP9 enabled. But, the encoding is horrendously slow, even for a short 1080p clip would take forever to finish.

1
  • 2024 update, I think there is some speed pumbup in the newer encoder
    – Salem F
    Commented Feb 20 at 14:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .