[FFmpeg-trac] #5140(undetermined:new): libvpx-vp9 rejects cpu-used values [-16, -9] and [9, 16]

FFmpeg trac at avcodec.org
Fri Jan 8 00:42:04 CET 2016


#5140: libvpx-vp9 rejects cpu-used values [-16, -9] and [9, 16]
-------------------------------------+-------------------------------------
             Reporter:  Bouowmx      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 libvpx-vp9 rejects cpu-used values from -16 to -9 and 9 to 16 (inclusive),
 even though the included help claims it can accept it. However, libvpx
 (VP8 only) accepts the mentioned values. This means that VP9 encoding will
 only use half of the CPU, whereas VP8 encoding can use all of it.

 The following is the help of libvpx-vp9:
 {{{
 ffmpeg -help encoder=libvpx-vp9
 ffmpeg version N-77715-gfc703f5 Copyright (c) 2000-2016 the FFmpeg
 developers
   built with gcc 5.2.0 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
 --enable-gnutls --enable-iconv --enable-libass --enable-libbluray
 --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype
 --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug
 --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-libvidstab --enable-libvo-aacenc --enable-
 libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack
 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs
 --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink
 --enable-zlib
   libavutil      55. 12.100 / 55. 12.100
   libavcodec     57. 21.100 / 57. 21.100
   libavformat    57. 21.101 / 57. 21.101
   libavdevice    57.  0.100 / 57.  0.100
   libavfilter     6. 23.100 /  6. 23.100
   libswscale      4.  0.100 /  4.  0.100
   libswresample   2.  0.101 /  2.  0.101
   libpostproc    54.  0.100 / 54.  0.100
 Encoder libvpx-vp9 [libvpx VP9]:
     General capabilities: delay threads
     Threading capabilities: auto
     Supported pixel formats: yuv420p yuv422p yuv440p yuv444p
 libvpx-vp9 encoder AVOptions:
   -cpu-used          <int>        E..V.... Quality/Speed ratio modifier
 (from -16 to 16) (default 1)
   -auto-alt-ref      <boolean>    E..V.... Enable use of alternate
 reference frames (2-pass only) (default auto)
   -lag-in-frames     <int>        E..V.... Number of frames to look ahead
 for alternate reference frame selection (from -1 to INT_MAX) (default -1)
   -arnr-maxframes    <int>        E..V.... altref noise reduction max
 frame count (from -1 to INT_MAX) (default -1)
   -arnr-strength     <int>        E..V.... altref noise reduction filter
 strength (from -1 to INT_MAX) (default -1)
   -arnr-type         <int>        E..V.... altref noise reduction filter
 type (from -1 to INT_MAX) (default -1)
      backward                     E..V....
      forward                      E..V....
      centered                     E..V....
   -deadline          <int>        E..V.... Time to spend encoding, in
 microseconds. (from INT_MIN to INT_MAX) (default good)
      best                         E..V....
      good                         E..V....
      realtime                     E..V....
   -error-resilient   <flags>      E..V.... Error resilience configuration
 (default 0)
      default                      E..V.... Improve resiliency against
 losses of whole frames
      partitions                   E..V.... The frame partitions are
 independently decodable by the bool decoder, meaning that partitions can
 be decoded even though earlier partitions have been lost. Note that intra
 predicition is still done over the partition boundary.
   -max-intra-rate    <int>        E..V.... Maximum I-frame bitrate (pct)
 0=unlimited (from -1 to INT_MAX) (default -1)
   -crf               <int>        E..V.... Select the quality for constant
 quality mode (from -1 to 63) (default -1)
   -static-thresh     <int>        E..V.... A change threshold on blocks
 below which they will be skipped by the encoder (from 0 to INT_MAX)
 (default 0)
   -undershoot-pct    <int>        E..V.... Datarate undershoot (min)
 target (%) (from -1 to 100) (default -1)
   -overshoot-pct     <int>        E..V.... Datarate overshoot (max) target
 (%) (from -1 to 1000) (default -1)
   -lossless          <int>        E..V.... Lossless mode (from -1 to 1)
 (default -1)
   -tile-columns      <int>        E..V.... Number of tile columns to use,
 log2 (from -1 to 6) (default -1)
   -tile-rows         <int>        E..V.... Number of tile rows to use,
 log2 (from -1 to 2) (default -1)
   -frame-parallel    <boolean>    E..V.... Enable frame parallel
 decodability features (default auto)
   -aq-mode           <int>        E..V.... adaptive quantization mode
 (from -1 to 3) (default -1)
      none                         E..V.... Aq not used
      variance                     E..V.... Variance based Aq
      complexity                   E..V.... Complexity based Aq
      cyclic                       E..V.... Cyclic Refresh Aq
   -speed             <int>        E..V....  (from -16 to 16) (default 1)
   -quality           <int>        E..V....  (from INT_MIN to INT_MAX)
 (default good)
      best                         E..V....
      good                         E..V....
      realtime                     E..V....
   -vp8flags          <flags>      E..V....  (default 0)
      error_resilient              E..V.... enable error resilience
      altref                       E..V.... enable use of alternate
 reference frames (VP8/2-pass only)
   -arnr_max_frames   <int>        E..V.... altref noise reduction max
 frame count (from 0 to 15) (default 0)
   -arnr_strength     <int>        E..V.... altref noise reduction filter
 strength (from 0 to 6) (default 3)
   -arnr_type         <int>        E..V.... altref noise reduction filter
 type (from 1 to 3) (default 3)
   -rc_lookahead      <int>        E..V.... Number of frames to look ahead
 for alternate reference frame selection (from 0 to 25) (default 25)
 }}}

 The following is the error I receive for using out-of-range cpu-used
 values:
 {{{
 ffmpeg -y -i "capture.mkv" -codec:v libvpx-vp9 -cpu-used 16 -f rawvideo
 NUL
 ffmpeg version N-77715-gfc703f5 Copyright (c) 2000-2016 the FFmpeg
 developers
   built with gcc 5.2.0 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
 --enable-gnutls --enable-iconv --enable-libass --enable-libbluray
 --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype
 --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug
 --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-libvidstab --enable-libvo-aacenc --enable-
 libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack
 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs
 --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink
 --enable-zlib
   libavutil      55. 12.100 / 55. 12.100
   libavcodec     57. 21.100 / 57. 21.100
   libavformat    57. 21.101 / 57. 21.101
   libavdevice    57.  0.100 / 57.  0.100
   libavfilter     6. 23.100 /  6. 23.100
   libswscale      4.  0.100 /  4.  0.100
   libswresample   2.  0.101 /  2.  0.101
   libpostproc    54.  0.100 / 54.  0.100
 Input #0, matroska,webm, from 'capture.mkv':
   Metadata:
     COMPATIBLE_BRANDS: isomiso2avc1mp41
     MAJOR_BRAND     : isom
     MINOR_VERSION   : 512
     ENCODER         : Lavf57.21.100
   Duration: 00:28:36.57, start: 0.000000, bitrate: 169973 kb/s
     Stream #0:0: Video: h264 (High 4:4:4 Predictive), yuv444p, 1280x960,
 SAR 1:1 DAR 4:3, 60 fps, 60 tbr, 1k tbn, 120 tbc (default)
     Metadata:
       HANDLER_NAME    : VideoHandler
       ENCODER         : Lavc57.21.100 libx264
       DURATION        : 00:28:36.567000000
     Stream #0:1: Audio: flac, 44100 Hz, stereo, s16
     Metadata:
       ENCODER         : Lavc57.21.100 flac
       DURATION        : 00:28:36.566000000
 [libvpx-vp9 @ 000002cce2f20b00] v1.5.0
 [libvpx-vp9 @ 000002cce2f20b00] Failed to set VP8E_SET_CPUUSED codec
 control: Invalid parameter
 [libvpx-vp9 @ 000002cce2f20b00]   Additional information: cpu_used out of
 range [-8..8]
 Output #0, rawvideo, to 'NUL':
   Metadata:
     COMPATIBLE_BRANDS: isomiso2avc1mp41
     MAJOR_BRAND     : isom
     MINOR_VERSION   : 512
     encoder         : Lavf57.21.101
     Stream #0:0: Video: vp9 (libvpx-vp9), yuv444p, 1280x960 [SAR 1:1 DAR
 4:3], q=-1--1, 200 kb/s, 60 fps, 60 tbn, 60 tbc (default)
     Metadata:
       HANDLER_NAME    : VideoHandler
       DURATION        : 00:28:36.567000000
       encoder         : Lavc57.21.100 libvpx-vp9
     Side data:
       unknown side data type 10 (24 bytes)
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> vp9 (libvpx-vp9))
 Press [q] to stop, [?] for help
 Received > 3 system signals, hard exiting time=00:00:00.33 bitrate=
 544.2kbits/s speed=0.0765x
 }}}

 Note that the following command (VP8 encoding) will use all of the CPU:
 {{{
 ffmpeg -i "capture.mkv" -codec:v libvpx -cpu-used 16 -f rawvideo NUL
 }}}
 Whereas the maximum you can use for VP9 encoding is only 50%:
 {{{
 ffmpeg -i "capture.mkv" -codec:v libvpx-vp9 -cpu-used 8 -f rawvideo NUL
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5140>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list