I'm trying to replicate Handbrake settings with ffmpeg, because I'd like to add some metadata and some other things with ffmpeg that Handbrake can not do.
What I've done seems to be close, the resulting file size and encoding time is similar, but Handbrake just produces visibly (but not drastically) better image.
Here's an example, ORIGINAL HANDBRAKE FFMPEG
These are cropped and zoomed in 300%. Here for example handbrake preserves more color in one of butterflies legs, more detail between the yellow parts of its wings, and in general seems more sharp. May be hard to notice what I'm talking about but the differences are there and more obvious on some other videos.
The x265 encoder versions are slightly different, but I believe that is not the reason for the difference. Handbrake has "x265 3.5+1-f0c1022b6" and ffmpeg has "x265 3.5+37-07b011400" but I've tried with ffmpeg with older x265 and the result was identical to the latest x265. And they are both inferior in my view to the Hanbrake.
Here are the screenshots of Handbrake Summary Dimensions Video
and the ffmpeg command
ffmpeg -i "in.mp4" -map_metadata -1 -vf scale=1280:720 -c:a copy -c:v libx265 -crf 27 -preset fast "out.mp4"
Here are the Mediainfos of all 3 files, including the original, the encoding logs, the Handbrake preset and the ffmpeg command: Pastebin Folder
Also for some reason the keyframes are in different places.
My question is, what can I change in my ffmpeg command to make the result identical to Handbrake?