intel / cartwheel-ffmpeg

Intel developer staging area for unmerged upstream patch contributions to FFmpeg
GNU Lesser General Public License v2.1
93 stars 33 forks source link

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

Open jian2x opened 1 year ago

jian2x commented 1 year ago

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 commented 1 year ago

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

xhaihao commented 1 year ago

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

wenbinc-Bin commented 1 year ago

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.

xuguangxin commented 1 year ago

@wenbinc-Bin can we close this?

wenbinc-Bin commented 1 year ago

Yes, I think we can close this ticket.