cartwheel-ffmpeg icon indicating copy to clipboard operation
cartwheel-ffmpeg copied to clipboard

"-svtav1-params" equivalent for av1_qsv encoder (to pass HDR10 mastering metadata)?

Open jian2x opened this issue 2 years ago • 5 comments

Hello, I am working to understand how to take advantage of the av1_qsv encoder with my A770 DG2 dGPU. I am trying to encode 10-bit AV1 files with HDR10, but I am struggling to understand how to encode the HDR10 metadata.

With svt-av1, you can pass in the parameters in ffmpeg using the "-svtav1-params" command-line option, for example: -c:v libsvtav1 -svtav1-params "preset=6:crf=13:tune=0:enable-hdr=1:color-primaries=9:transfer-characteristics=16:matrix-coefficients=9:mastering-display=G(0.265,0.69)B(0.15,0.06)R(0.68,0.32)WP(0.3127,0.329)L(4000.0,0.005):content-light=1000,755" (svtav1 parameters are all documented here: https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/Docs/Parameters.md ). The x265 encoder has an equivalent option (x265-params) as well.

Is there a way to do the equivalent with the OneVPL / av1_qsv encoder in ffmpeg?

Thanks!

jian2x avatar Jan 18 '23 09:01 jian2x

Issue tracking link : https://github.com/oneapi-src/oneVPL/issues/87

jian2x avatar Jan 18 '23 09:01 jian2x

@jian2x You should use AVFrame::side_data to pass your HDR metadata to av1_qsv encoder.

xhaihao avatar Feb 06 '23 06:02 xhaihao

You can also directly set the related parameter in commandline like this. Sample command: ffmpeg -v verbose -i input.264 -c:v av1_qsv -color_primaries bt2020 -color_trc bt2020-10 -colorspace bt2020nc -vframes 300 output.ivf These parameters are in AVCodecContext structure. Qsv encoder can pass them to VPL.

wenbinc-Bin avatar Feb 16 '23 08:02 wenbinc-Bin

@wenbinc-Bin can we close this?

xuguangxin avatar Jul 07 '23 03:07 xuguangxin

Yes, I think we can close this ticket.

wenbinc-Bin avatar Jul 07 '23 04:07 wenbinc-Bin