diff mbox series

[FFmpeg-devel] libavcodec/amfenc_hevc: Recommend values for min and max video quantizer scale.

Message ID 20210309155700.1129-1-ovchinnikov.dmitrii@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel] libavcodec/amfenc_hevc: Recommend values for min and max video quantizer scale. | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Ovchinnikov Dmitrii March 9, 2021, 3:57 p.m. UTC
Current settings makes bitrate large, than expected, more information:
https://github.com/HandBrake/HandBrake/issues/3447#issue-820490736

---
 libavcodec/amfenc_hevc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

James Almer March 9, 2021, 4:15 p.m. UTC | #1
On 3/9/2021 12:57 PM, Ovchinnikov Dmitrii wrote:
> Current settings makes bitrate large, than expected, more information:
> https://github.com/HandBrake/HandBrake/issues/3447#issue-820490736
> 
> ---
>   libavcodec/amfenc_hevc.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
> index 77e57d2461..890272d135 100644
> --- a/libavcodec/amfenc_hevc.c
> +++ b/libavcodec/amfenc_hevc.c
> @@ -298,6 +298,8 @@ static const AVCodecDefault defaults[] = {
>       { "b",          "2M"  },
>       { "g",          "250" },
>       { "slices",     "1"   },
> +    { "qmin",       "0"   },
> +    { "qmax",       "51"  },

How about setting both to -1 instead? That way the encoder defaults 
would be used. Assuming there are any, and initialization will not fail 
if neither {min,max}_qp_{i,p} and qmin/qmax are set.

>       { NULL                },
>   };
>   static const AVClass hevc_amf_class = {
>
Thilo Borgmann March 9, 2021, 4:17 p.m. UTC | #2
Hi,

Am 09.03.21 um 16:57 schrieb Ovchinnikov Dmitrii:
> Current settings makes bitrate large, than expected, more information:
> https://github.com/HandBrake/HandBrake/issues/3447#issue-820490736

I agree to the comments on your issue tracker[1], that it would be better to solve this by setting qmin/qmax explicitly in handbrake (or whatever application) than by changing their defaults.

[1] https://github.com/HandBrake/HandBrake/issues/3447#issuecomment-790178099

-Thilo
diff mbox series

Patch

diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
index 77e57d2461..890272d135 100644
--- a/libavcodec/amfenc_hevc.c
+++ b/libavcodec/amfenc_hevc.c
@@ -298,6 +298,8 @@  static const AVCodecDefault defaults[] = {
     { "b",          "2M"  },
     { "g",          "250" },
     { "slices",     "1"   },
+    { "qmin",       "0"   },
+    { "qmax",       "51"  },
     { NULL                },
 };
 static const AVClass hevc_amf_class = {