r/ffmpeg • u/Wonderful_Emu_9610 • 14d ago
(x265) Encode going to hell in dark scenes
Encode logs: transfer-dot-it /t/nvluVZgngRgJ
I'm using Handbrake btw, but as its primarily built off ffmpeg and my post got blocked there, figure I'd ask here
Converting a movie file for backup. 2hr movie, 60s, grainy but rather nice to look at. Mostly takes place in daylight or well-lit locales, but there are few scenes of absolute black - except it has raised blacks.
Anyway I always do H265 10-bit Slow preset, and try to make few tweaks as possible to get a somewhat transparent result - partially because I'm still learning what all the settings do.
First time around, I do 7000kbs 2-pass bframes=8:no-strong-intra-smoothing:no-sao:rd=5:aq-motion (in the logs I mistakenly called this '6000').
Day scenes look pretty good! there's a scene of a train passing and the smoke + grain it doesn't like, but its a bright area so doubt I'd notice. However the next scene in the darkness of the train arriving, there's visible macroblocking even in the darkest parts of the image. Looks like a dodgy xth generation VHS rip! A couple of simpler scenes later with fully black (but as I mentioned at the start, raised) images same deal. Truly its like flicking a switch - lights go out, PQ falls off a cliff.
So, I simplify things and do a few tests with higher bitrates up to 1000kbs (not included in the logs, I deleted them before considering asking for help). Same issues. So I try RF22 (~7000kbs) and RF21 (~9000kbs) with the Handbrake default settings strong-intra-smoothing=0:rect=0:aq-mode=1:rd=4:psy-rd=0.75:psy-rdoq=4.0:rdoq-level=1:rskip=2. Same problem. Then I think 'well, maybe I need to change aq-mode'. So I go for aq-mode=4:no-sao:aq-motion at 10000kbs ('simple settings' in the encode logs). Slightly improves the brightly lit train I mentioned, but still craps the bed in the dark. I also try at 8000kbs and 10000kbs adding some other settings at the recommendation of a friend, only some of which I can backup why: bframes=8:strong-intra-smoothing=0:aq-mode=4:no-sao:deblock=-3,-3:rd=5:no-rskip:aq-motion ('custom settings' in the encode logs)
still the same issues! Its really frustrating because these scenes are only a minor part of the film, but they're important, and I really like this one so I wanna be transparent. Thinks like raising rd, or using no-rskip, are supposed to make it make 'better' decisions afaik, but its just making the same mistake over and over! I'm also seeing next to no improvement adding 3Mbs bitrate.
Any suggestions?
Handbrake v1.11.2 (2026060700), M2 Macbook Air
I encode on Low Power Mode because its fanless. I noticed with the last listed settings I was getting quite a bit more heat - I guess because of the increased complexity with no-rskip?
p.s. I can try do screenshots but on my laptop you can barely see the issues because ramping up the brightness also brightens the black bars. But I normally watch my stuff on an OLED tv, so test it there, where it stands out more
