Samples: Transcoder seem to ignore target bitrate

I’m running AppTransOneToN or AppTrans from Samples, passing them some input and asking to produce target with different bitrates. The output files are of the same size for both bitrates. When I wrap them into mp4 container (with ffmpeg) and check for metadata (with mediainfo), the bitrate for both is the same and is different from any specified target rate
To Reproduce
Steps to reproduce the behavior:

  1. Make AppTransOneToN or AppTrans
  2. Run any of them with arguments -i input_file -codec hevc -gpu 0 -bitrate target_br -o output_file, with target_br 5Mb and 20Mb
  3. Compare file sizes for the output files, they will be the same.
  4. Wrap each output file to mp4 container (ffmpeg -i my_file my_file.mp4)
  5. For each mp4 file run mediainfo -a mp4_file | grep - i rate. The bitrate displayed will be the same and completely different from 5Mb or 20Mb

Expected behavior
Different sizes for transcode results to 5Mb and 20Mb, and some close to 5Mb and 20Mb bitrate output from mediainfo.

Desktop (please complete the following information):

  • OS: 5.13.0-41-generic #46~20.04.1-Ubuntu
  • Nvidia driver version:
    ±----------------------------------------------------------------------------+
    | NVIDIA-SMI 470.129.06 Driver Version: 470.129.06 CUDA Version: 11.4 |
    |-------------------------------±---------------------±---------------------+
    | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
    | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
    | | | MIG M. |
    |===============================+======================+======================|
    | 0 NVIDIA GeForce … Off | 00000000:02:00.0 Off | N/A |
    | 40% 28C P8 N/A / 75W | 14MiB / 3910MiB | 0% Default |
    | | | N/A |
    ±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1170 G /usr/lib/xorg/Xorg 9MiB |
| 0 N/A N/A 2411 G /usr/bin/gnome-shell 2MiB |
±----------------------------------------------------------------------------+

  • CUDA Version 11.4
  • Video Codec SDK Version 9.1.23