diff options
author | PMunkes <[email protected]> | 2021-03-04 09:44:50 +0100 |
---|---|---|
committer | Scott <[email protected]> | 2021-03-09 23:15:41 +0000 |
commit | 7ae1c6af628395755bdc9bd10b62b0ff9705bb09 (patch) | |
tree | 4417fcc1585b9d17e73d81da71513a3d71f0504a /libhb/encavcodec.c | |
parent | 383ec399656d73130cc81cee3fd0a96ba50340f5 (diff) |
Correct QP range when using ffmpeg VCE H265
By default ffmpeg restricts qp factors to a range of 2 to 31, unless otherwise overwritten. This significantly constrains the low bitrate performance of VCE in H.264 mode.
This should fix issue #3447 and could also address parts of issue #2980.
Diffstat (limited to 'libhb/encavcodec.c')
-rw-r--r-- | libhb/encavcodec.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c index fb7f1adee..a43175b45 100644 --- a/libhb/encavcodec.c +++ b/libhb/encavcodec.c @@ -343,6 +343,15 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job ) if ( job->vcodec == HB_VCODEC_FFMPEG_VCE_H264 || job->vcodec == HB_VCODEC_FFMPEG_VCE_H265 ) { av_dict_set( &av_opts, "rc", "vbr_peak", 0 ); + //Work around an ffmpeg issue mentioned in issue #3447 + if (job->vcodec == HB_VCODEC_FFMPEG_VCE_H265) + { + av_dict_set( &av_opts, "min_qp_i", 1, 0 ); + av_dict_set( &av_opts, "min_qp_p", 1, 0 ); + + av_dict_set( &av_opts, "max_qp_i", 51, 0 ); + av_dict_set( &av_opts, "max_qp_p", 51, 0 ); + } hb_log( "encavcodec: encoding at rc=vbr_peak Bitrate %d", job->vbitrate ); } |