AMF icon indicating copy to clipboard operation
AMF copied to clipboard

[Feature Request] High Quality Preset

Open cdgriffith opened this issue 4 years ago • 3 comments

Hello, first off I apologize if this is not the right place for requests, if there is a better place to ask please point me there!

I think it would benefit the community if AMF had a higher quality preset.

Running some tests on UHD HDR10 material using VCEEncC between speed and quality yielded a negligible time difference.

  • VCE speed – 64.34 fps
  • VCE quality – 63.67 fps

However what impressed me was the calculated score difference:

  • VCE speed – VMAF score: 94.795631
  • VCE quality – VMAF score: 96.456107

If this was to be taken further, even to the point of a huge speed reduction, it would still be a major step in making AMF not only good for live streaming but also archival. In such a case using AMF would be faster and a lot more energy efficient than software alternatives.

To set an example ceiling score in this encode's instance, x265 on its slowest setting (other than placebo) can achieve a VMAF score of 98.270874 at the same bitrate. If it somehow possible to even bump up from 96.4 to say 97 in a case like this would be huge.

Test Settings

VCEEnc (x64) 6.14 (r929) by rigaya, Aug 11 2021 22:51:43 (VC 1929/Win) AMF Version 1.4.21 Drivers 21.7.2

Hardware 6900xt Sample command:

VCEEncC64.EXE -i  glass.hevc --video-metadata clear --chapter-copy -c hevc --vbr 5000 --preset slow --tier high --colormatrix bt2020nc --transfer smpte2084 --colorprim bt2020 --master-display "G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(40000000,50)" --max-cll "0,0" --output-depth 10 --motion-est q-pel --pe --chromaloc auto --colorrange auto --avsync cfr --psnr --ssim -o glass-vce-5000k-pe-slow.mkv

Source video from https://developer.dolby.com/tools-media/sample-media/video-streams/dolby-vision-streams/ using Glass Blowing @59.94fps: Dolby Vision Profile 8.1 UHD – Dolby Atmos

Encoding it from ~15M to 5M bitrate.

cdgriffith avatar Aug 13 '21 18:08 cdgriffith

This is a good place to discuss such issues. The performance issue you brought could be caused by number of reasons but based on description I would assume that the application is not bound by HW encoder performance but by something else. For example, the command line for the app asks for PSNR and and SSIM calculation. If it is done using AMF it is done after encoding and would significantly affect overall performance, The same could be true for VCEEncC internal implementation. It is hard to analyze every app but you can compare this with AMF sample TranscodeHW. All encoder parameters can be set via CMD.

Also you can capture 5-10 seconds of GPUVIEW log, ZIP it and share. It will tell a lot.
Thanks

MikhailAMD avatar Aug 13 '21 20:08 MikhailAMD

Ah good catch, yes the metrics were slowing down the encode significantly. Updated:

  • VCE speed – 118.10 fps
  • VCE quality – 96.47 fps

Which I just have to say, for UHD is simply blazing 🤩

But the main thing I am worried about isn't the speed, but the quality. (Which also as you pointed out, this is a different app, so maybe just doesn't have all the options?) I have found that best results is with preset slow and pre-encode enabled (6900xt seems to not support B-frames or Pre-Analysis), and I know VBAQ is better for human eyes, but will distort the VAMF results so it is disabled.

FFmpeg AMF on windows doesn't seem to support HDR10 mastering-display data, so have been sticking with VCEEncC for the time being.

My end goal is to add VCE Encoding support to FastFlix which is primary use case for re-encoding video files (aka archival) so I want to be able to achieve the highest quality possible.

cdgriffith avatar Aug 13 '21 20:08 cdgriffith

It is a little bit hard to analyze every application for parameter translation into AMF API. But if you trace full AMF parameter set with values the app sets and share with me I can provide guidance to achieve the best quality VCN can get.

MikhailAMD avatar Aug 13 '21 21:08 MikhailAMD

Closing due to inactivity

rhutsAMD avatar Oct 26 '23 21:10 rhutsAMD