Code Monkey home page Code Monkey logo

Comments (1)

nkh0472 avatar nkh0472 commented on June 11, 2024

In Video-Encoding section, when change Quality option from "Auto" to any other option such like "Ultra", the default bitrate control method is "CRF", whether or not the nvenc encoder is enabled.
However, h264_nvenc is not support --crf flag according to ffmpeg --help encoder=nvenc.
Thus when hit Convert button, the ffmpeg will give an error as below and exit.

Codec AVOption crf (Select the quality for constant quality mode) specified for output file #0 (X:\output.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
[h264_nvenc @ 000001ea39c007c0] Specified rc mode is deprecated.
[h264_nvenc @ 000001ea39c007c0] Use -rc constqp/cbr/vbr, -tune and -multipass instead.
[h264_nvenc @ 000001ea39c007c0] InitializeEncoder failed: invalid param (8): Presets P1 to P7 are not supported with older 2 Pass RC Modes(CBR_HQ, VBR_HQ) and cbr lowdelay.
Enable NV_ENC_RC_PARAMS::multiPass flag for two pass encoding a
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

Instead, we can use -cq:v number to replace -crf number when h264_nvenc is enabled.
-cq <float> E..V....... Set target quality level (0 to 51, 0 means automatic) for constant quality mode in VBR rate control (from 0 to 51) (default 0)
And use optional flags -maxrate:v number -bufsize number to constrain bitrate.


However there is another bug:
In Video-Encoding section, when set Quality to Custom, set Pass to 1 Pass or 2 Pass, the Bit Rate values disappear in script. That means even I input numbers in Bit Rate Min Rate and other 2 blanks, the script will still looks like:

......
-c:v h264_nvenc 
-preset slow 
-pix_fmt yuv420p 
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" 
-map 0:v:0?
......

Only when using default quality options like High, the script works correctly:

......
-c:v h264_nvenc 
-preset slow -q:v 2500K 
-pix_fmt yuv420p 
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" 
-map 0:v:0? 
......

from axiom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.