Log in

View Full Version : Need x264 encoding settings advice


o9od2061
8th December 2012, 00:18
Hello,
I need to re-encode a bunch of videos taken with an iPhone 4 to a lower bitrate. The source video is 720p, very shaky in places, and can be grainy in dark areas. The source average bitrate is ~11000kb/s, my target is 5000kb/s.
What would be good settings to squeeze in as much detail as possible? Processing time is completely unimportant. I'm currently using 2pass encoding with these settings: --preset veryslow --threads 2 --keyint 512 --min-keyint 25 --open-gop --ratetol 3.0 --aq-mode 2 --merange 64 --me tesa --subme 11 --no-fast-pskip
Also, will using --nr help at all?

Thanks for any help.

LoRd_MuldeR
8th December 2012, 00:28
If you need to hit a pre-defined target (average) bitrate, then 2-Pass is the way to go, indeed :)

Other than that, all you need is "--preset" with the slowest Preset you can accept (probably "veryslow" in your case, "placebo" is pointless) plus "--tune" with the Tune that matches your footage ("animation" for cartoon/anime, "film" for pretty much anything else including real-life footage). All the other options you mention are either already controlled by the Preset/Tune, don't need to be set manually or are not generally useful/recommended.

About the "--nr" option: It enables a (pretty simple) noise reduction filter. I'm usually not a big fan of denoising. And if I do denoising, I prefer something like MDegrain...

Blue_MiSfit
10th December 2012, 00:14
2 pass, with --preset veryslow.

Do you need to make these videos compatible with hardware (i.e. playback on the iPhone itself)? If so, you should add some VBV values - I'd probably use Main Profile @ 3.1 as a starting point. So, add --vbv-maxrate 14000 --vbv-bufsize 14000. Sometimes you can use a larger bufsize, but it probably won't help quality at all.

I agree with mulder - use x264 nr if you don't have anything else and really need to denoise. If time is really of no concern, then use AviSynth to process your video, and do consider MDegrain or similar. You also mentioned that your videos are very shaky - this can probably be improved with one of the powerful stabilization filters for AviSynth. I'm not personally familiar with this kind of processing, but I'm sure some searching in the AviSynth Usage forum will reveal plenty of possibilities.

Derek

fvisagie
10th December 2012, 06:48
For fixing hand shake I'd recommend VirtualDub with Deshaker. As a newcomer to deshaking software I found it easier to get going with than Avisynth alternatives, and it also managed to compensate larger movements. For mechanical vibration or other smaller movements the Avisynth options seemed perfectly fine.