NVIDIA / VideoProcessingFramework

Set of Python bindings to C++ libraries which provides full HW acceleration for video decoding, encoding and GPU-accelerated color space and pixel format conversions
Apache License 2.0
1.32k stars 233 forks source link

Encoded file very big when set bf=0 #411

Open InkosiZhong opened 1 year ago

InkosiZhong commented 1 year ago

I test the official sample SampleEncode.py. It performs well and produces a video lesser then 5M. However, if i add a 'bf': '0' at nvc.PyNvEncoder construction function to disable B-frame, the video it encoded costs 96M.

# before
nvEnc = nvc.PyNvEncoder({'preset': 'P5', 'tuning_info': 'high_quality', 'codec': 'hevc',
                             'profile': 'high', 's': res, 'bitrate': '10M'}, gpuID)
# after
nvEnc = nvc.PyNvEncoder({'preset': 'P5', 'tuning_info': 'high_quality', 'codec': 'hevc',
                             'profile': 'high', 's': res, 'bitrate': '10M', 'bf': '0'}, gpuID)