Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom codec options for VP9 Opus #634

Open
Gfurst opened this issue Mar 7, 2018 · 4 comments
Open

Custom codec options for VP9 Opus #634

Gfurst opened this issue Mar 7, 2018 · 4 comments

Comments

@Gfurst
Copy link

Gfurst commented Mar 7, 2018

Please consider adding option support for the most common codec options used, or document them if already supported.
Or do they already work out of the box, in that option=parameter fashion?

@MaartenBaert
Copy link
Owner

FFmpeg has two different option mechanisms. All codec-specific options (a.k.a. AVOptions) should already work as it is, but options that are set at a higher level need to be added manually. This also includes a lot of older options that should really be codec-specific but were introduced before the codec-specific option mechanism was created.

You can get a list of codec options explicitly supported by SSR here:
http://www.maartenbaert.be/simplescreenrecorder/custom-codec-options/
You can see all available options in ffmpeg by running ffmpeg -h full. Anything under AVOptions should work. Other options can be added if you tell me which ones you need.

@Gfurst
Copy link
Author

Gfurst commented Mar 9, 2018

Sorry for not getting a much descriptive post to begin with, but I super sleepy at that time.
Anyway, that was sort of the question there, would codec specific options just work out of the box?

For example, specifically to vp9, there are some options that can drastically improve performance, like tile-columns and tile-row, along with speed, quality to define speed/quality ratio, and of course crfdoes also apply here.

In the case of audio, I've also found that some generic options don't seem to work, couldn't get sampleformat to work. Another use case is libvorbis for example, where you shouldn't set a bitrate manually but rather a quality factor with generic option `-aq.

@MaartenBaert
Copy link
Owner

Like I said, if you run ffmpeg -h full you will get the list of options for each codec:

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 4) (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
     equator360                   E..V.... 360 video Aq
  -level             <float>      E..V.... Specify level (from -1 to 6.2) (default -1)
  -row-mt            <boolean>    E..V.... Row based multi-threading (default auto)
  -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)

In addition to these, you can use the basic options listed here:
http://www.maartenbaert.be/simplescreenrecorder/custom-codec-options/

The sampleformat option definitely works, but not all codecs will accept all formats, and even if a codec accepts a format it doesn't mean that this is actually the format that gets written to the file.

The aq option is the same as qscale but for audio. Just use qscale in the audio codec options field and it would work. I've updated the documentation to make this more clear.

@petterreinholdtsen
Copy link
Contributor

What about making VP9 and Opus easy options to select in the user interface?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants