[FFmpeg-trac] #7300(undetermined:closed): h264_nvenc / weighted_pred not working with B Frame parameter

FFmpeg trac at avcodec.org
Mon Oct 21 05:44:26 EEST 2024


#7300: h264_nvenc / weighted_pred not working with B Frame parameter
-------------------------------------+-------------------------------------
             Reporter:               |                    Owner:  (none)
  smallishzulu                       |
                 Type:  defect       |                   Status:  closed
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:  fixed
             Keywords:  nvenc        |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Changes (by Balling):

 * status:  new => closed
 * resolution:   => fixed

Comment:

 Works now. [h264_nvenc @ 000001cc049cec00] InitializeEncoder failed:
 invalid param (8): Weighted Prediction not supported with B-frames.

 is printed in unsupported configurations. -b 0 no longer works to disable
 B-frames. So have to use -preset p2 instead, as -preset p3 already enables
 B frames, see


 https://github.com/FFmpeg/nv-codec-
 headers/blob/9934f17316b66ce6de12f3b82203a298bc9351d8/include/ffnvcodec/nvEncodeAPI.h#L2136

 enableWeightedPrediction  :1;    /**< [in]: Set this to 1 to enable
 weighted prediction. Not supported if encode session is configured for
 B-Frames (i.e. NV_ENC_CONFIG::frameIntervalP > 1 or preset >=P3 when
 tuningInfo = ::NV_ENC_TUNING_INFO_HIGH_QUALITY or tuningInfo =
 ::NV_ENC_TUNING_INFO_LOSSLESS. This is because preset >=p3 internally
 enables B frames when tuningInfo = ::NV_ENC_TUNING_INFO_HIGH_QUALITY or
 ::NV_ENC_TUNING_INFO_LOSSLESS). */

 ffmpeg -i https://trac.ffmpeg.org/raw-attachment/ticket/9573/test.mkv
 -aspect 16:9 -s 720x576 -map 0:0 -c:v:0 h264_nvenc -temporal-aq 1 -aq-
 strength 15 -2pass 1 -preset p2 -cbr 1 -rc cbr -profile:v main -vb 1550k
 -minrate 1550k -maxrate 1550k -bufsize 1550k -muxrate 1790k  -r 25
 -pix_fmt yuv420p -c:a:0 aac -g 50 -f mpegts -weighted_pred 1 cool.mp4
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/7300#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list