VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. I use the following sentence to create a 14-second video in FFMPEG:

    Code:
    ffmpeg -i video.mkv -vf subtitles=video.mkv -ss 00:49:32 -t 14 -c:v libvpx -b:v 15m -sn -s 700x394 -crf 14 output.webm
    The result was like this:

    https://webmshare.com/rZ4XQ

    It's fine and all, but if notice, for some seconds the quality drops, like this:



    And then immediately goes back to this:




    I can't find any fault on the ffmpeg sentence that would give this problem.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Maybe try vp9, libvpx-vp9 instead of libvpx

    See https://trac.ffmpeg.org/wiki/Encode/VP9

    And are you using a newer ffmpeg version?
    Quote Quote  
  3. Originally Posted by Baldrick View Post
    Maybe try vp9, libvpx-vp9 instead of libvpx

    See https://trac.ffmpeg.org/wiki/Encode/VP9

    And are you using a newer ffmpeg version?
    Yes, i am using a newer version.

    I guess libvpx-vp9 is better.

    Thanks for the help.
    Last edited by Unknown01; 24th Jan 2017 at 15:32.
    Quote Quote  
  4. I use something like bellow but it is very slow setting (practically unusable - used by me for VP9 testing on small video).
    Code:
    ffmpeg -y -color_range 2 -i "%1" -an -c:v libvpx-vp9 -speed 0 -quality best -tile-columns 0 -frame-parallel 0 -auto-alt-ref 1 -lag-in-frames 25 -g 9999 -aq-mode 0 "%~n1_.webm"

    best quality tile-columns 0, frame-parallel 0: Turning off tile-columns and frame-parallel should give a small bump in quality, but will most likely hamper decode performance severely.
    Most of the current VP9 decoders use tile-based, multi-threaded decoding. In order for the decoders to take advantage of multiple cores, the encoder must set tile-columns and frame-parallel.
    Setting auto-alt-ref and lag-in-frames >= 12 will turn on VP9's alt-ref frames, a VP9 feature that enhances quality.
    speed 4 tells VP9 to encode really fast, sacrificing quality. Useful to speed up the first pass.
    speed 1 is a good speed vs. quality compromise. Produces output quality typically very close to speed 0, but usually encodes much faster.
    Multi-threaded encoding may be used if -threads > 1 and -tile-columns > 0.

    Code:
    ffmpeg -i <source> -c:v libvpx-vp9 -pass 2 -b:v 1000K -threads 1 -speed 0 -tile-columns 0 -frame-parallel 0 -auto-alt-ref 1 -lag-in-frames 25 -g 9999 -aq-mode 0 -c:a libopus -b:a 64k -f webm out.webm
    Code:
    Encoder libvpx-vp9 [libvpx VP9]:
        General capabilities: delay threads 
        Threading capabilities: auto
        Supported pixel formats: yuv420p yuva420p yuv422p yuv440p yuv444p yuv420p10le yuv422p10le yuv440p10le yuv444p10le yuv420p12le yuv422p12le yuv440p12le yuv444p12le gbrp gbrp10le gbrp12le
    libvpx-vp9 encoder AVOptions:
      -auto-alt-ref      <int>        E..V.... Enable use of alternate reference frames (2-pass only) (from -1 to 2) (default -1)
      -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....
      -tune              <int>        E..V.... Tune the encoding to a specific scenario (from -1 to INT_MAX) (default -1)
         psnr                         E..V....
         ssim                         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)
      -drop-threshold    <int>        E..V.... Frame drop threshold (from INT_MIN to INT_MAX) (default 0)
      -noise-sensitivity <int>        E..V.... Noise sensitivity (from 0 to 4) (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)
      -cpu-used          <int>        E..V.... Quality/Speed ratio modifier (from -8 to 8) (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
      -level             <float>      E..V.... Specify level (from -1 to 6.2) (default -1)
      -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)
    Last edited by pandy; 25th Jan 2017 at 06:29.
    Quote Quote  
  5. From an ffmpeg dev about vp9 encoding:
    "speed" is just an (legacy) alias for "cpu-used", which is your primary knob for performance/quality trade-off. Its a bit oddly named for sure.
    cpu-used=0 is the slowest and highest quality mode, going up to 9 for vp9 as the fastest mode.

    On top of that, you have the quality mode, which is either "good" or "best" (or "realtime" which is only useful for what the name suggests it would be).
    "best" is often overkill and even the vpx docs don't recommend using it, its akin to a placebo mode in libx264.

    So in short, start with quality=good (which is also the default, so may as well skip it) and try a few cpu-used modes to dial in your performance/quality tradeoff.

    Various explanations for the options are here, if it wasn't linked above already:
    http://www.webmproject.org/docs/encoder-parameters/

    Note that not all options map 1:1 if you use ffmpeg as a wrapper to the encoder, but most probably do.
    https://forum.doom9.org/showpost.php?p=1790354&postcount=972
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!