Log in

View Full Version : h264 -> h265 re-encoding suggestion


Kalasnyikov
18th June 2016, 13:18
Hello

I have a big library of TV Shows, and I want to reencode to h265. After make it some test, use this settings:


ffmpeg \
-i "$INFILE" \
-c:v libx265 \
-preset veryfast \
-x265-params \
crf=22:\
qcomp=0.7:\
ctu=32:\
max-tu-size=16:\
aq-mode=1:\
aq-strength=1.0:\
psy-rd=0.7:\
psy-rdoq=5.0:\
rdoq-level=1:\
merange=50:\
sao=0:\
rect=0:\
amp=0:\
deblock=-2\\:-2 \
-c:a libfdk_aac \
-cutoff 18000 \
-profile:a aac_he \
-b:a 128k \
-y "$NEWFILE"

(this is one part of my convert script, I'm on Arch linux)

This settings is used toy re-encode 1080p source, but I read the optimal settings for 1080p and 720p is different.

So, my questions is:
- this setting are good, or need some change?
- what parameter change to use that if the source is 720p resolution?

Many thanks any answer and sorry my scary english..

MeteorRain
18th June 2016, 21:13
May I ask why you want to re-encode these videos? Each round of re-encoding will reduce the quality and lower the encoding efficiency.

Kalasnyikov
18th June 2016, 21:25
It's true, but I don't have endless HDD space, and the file size different is very impressive. Make some test and if the old file is 3.2 Gb the new file is 600-800Mb, with almost same quality. The "almost" meaning: when grabbing sample pictures I notice some artifact, but when I seeing on my TV no different.

benwaggoner
22nd June 2016, 18:28
It's true, but I don't have endless HDD space, and the file size different is very impressive. Make some test and if the old file is 3.2 Gb the new file is 600-800Mb, with almost same quality. The "almost" meaning: when grabbing sample pictures I notice some artifact, but when I seeing on my TV no different.
Using "veryfast" is going to throw away a lot of quality. Have you tried somewhat slower presets to verify that they don't yield acceptable throughput? A lot of the good stuff in x265 doesn't even engage at that low a preset. For example, psy-rd doesn't activate unless rd is at least 3, which doesn't come in until preset medium. You'll get better looking and smaller CRF 22 if you can go up a couple of presets. Honestly, I feel like "slower" is where x265 really is able to strut its stuff pretty fully.

Otherwise, these seem pretty good for 480p-1080p to me.

I think it's probably okay to use ctu=64 and qgsize=32 at 1080p now, although sticking with your current values for 720p is probably good.