HEVC Quality in AVFoundation on macOS lower than ffmpeg

Hi - I'm using AVFoundation with AVAssetWriter to create an HEVC using custom settings (as opposed to using AVAssetExportSession). I'm on an iMac without hardware acceleration.


I specify a bitrate using AVVideoAverageBitRateKey to be 60% of the bitrate of the H264 original video and turned on multiple passes. While the quality is acceptable, if I use ffmpeg to obtain a file of similar size and bitrate, the file encoded by ffmpeg is superior in detail to that encoded by AVFoundation.


I have tried various other settings but all appear to only be valid for H264, and there does not seem to be a way to vary the quality of HEVC with AVFoundation.


Does anyone have any suggestions on how to get AVFoundation to increase quality to match ffmpeg?