Log in

View Full Version : My x264 (resize) settings. Improvements?? Anyone???


raiden2k5
27th November 2012, 22:18
Hi.
Finally! 5 days passed and I am able to post here! Thanks for this great forum!

I've read a lot on this matter but nothing better than trying myself with some test encondes.

I am downscaling (resizing) my 1080p (9~20GB file size) collection to 720p cuz storage space is an issue here and I figured out that it really doesn't make a huge difference on my Sony 40" 3D LED or on my 720p 3D DLP native video projector (1080p capable).

I'm kicking out the DTS track from the MKV and converting it to AC3 with eac3to/Arcs*ft DTS filter for the best quality. This way I'm releasing about 1GB/each file.

So, encoding time is not a problem here but I would like to skip the placebo-ish settings (24hrs+ encoding times).
I am using these settings for the downscaling and encoding (for 23.976fps hence 24000/1001 when using other framerates I adapt so I’ll avoid desync’ed sound and subtitles):

"x264 x64 8bit.exe" --profile high --level 4.1 --mixed-refs --fps 24000/1001 --no-fast-pskip --force-cfr --ref=9 --deblock=-1,-1 --analyse=all --me=umh --psy-rd=1.00,0.15 --subme=10 --merange=24 --trellis=2 --nr=100 --bframes=16 --b-adapt=2 --direct=auto --open-gop --weightp=2 --rc-lookahead=120 --crf=18.0 --video-filter resize:1280,720,,both,method=lanczos4 -o "d:\MOVIES\%%I-resized.mkv" "%%I")

Oh, I am using ref=9 cuz my WD(LX)TV can’t go along with more than this. There are no issues with my Asus O’Play HD2 but I need to keep it low for the other one.

Where "%%I" is the filename (I'm using a batch with the for-loop to make it auto fetching files on a given directory).

On my laptop with Ci7 and ATI 5870, I am also using a moded version of X264 with options --stylish and --opencl (maybe I am not getting a speed improvement but I am trying not to burn my CPU by handing over some work to the GPU).

Basically I am using this command line for almost everything, including my DVD collection backup (25fps, 720*576) where I just modify the framerate and remove the video filter RESIZE as it’s not needed.

With these I get a good compression ratio and image quality. Dark movies benefit from it, giving extremely low bitrates and keeping superb image quality (I get a 1.9GB/720p@2.145Kbps video track from the original 9.1GB/1080p@8.605Kbps).

But sometimes I notice an unpleasant blocking on gradients like the sky. It looks random. Some movies are superb, flawless. Others I notice it a lot, so I guess these settings can't be used with everything from films to animations (Pi*ar alike).

What options do you thing I might use/change to avoid this?

Is Lanczos4 not the best filter for resize?

I don’t really care if it takes 14 hours to encode. Also I don’t try to keep it within a certain file size (it’s ok to have a 3GB or a 5GB file size as long it’s almost the same feel as the original, but the shorter the better). That’s why I trade small file size and high image quality for encoding time.

Notice I am using CRF=18 for quality. I aim to keep the image quality to be as close to the original as possible.

Should I use different options when encoding/resizing HD x264 files and SD mpeg2-VOBs?

What’s your opinion?

Thanks in advance for your help/comments.

Best regards to all.

raiden trad

Asmodian
28th November 2012, 02:28
Lanczos4 is very sharp and causes some ringing. It take more bits to encode but that would just make your files larger rather than causing banding/blocking. Make sure you compare against the source. I have spent a while trying to get rid of banding or blocking only to discover that scene was also terrible on the bluray. :o

You could try lots of things but as you have a pretty detailed command line I assume you picked these options for a reason. :)

Maybe no --nr=100 and trade 16 b-frames for 8 b-frames and --no-fast-pskip?

I would try bicubic or spline and a maybe a slightly lower crf, say 17.5?

raiden2k5
28th November 2012, 09:30
Hi, thanks for your inputs!

I just started this encoding task of mine and I welcome any help with it.

The issue is that on some movies it's ok, (almost) no banding/ringing but on others itīs so evident!

If 1080p has a lot more information (bits) than 720p, why do I get these problems?

I use Lanczos4 because I read that it was good keeping sharpness (detail is what I think I am after to keep it as close to the original).

I'll try your tips and see if they work on those files that I get the problems.

Just one more question (I am not english so I may be understanding wrongly your point of view): --no-fast-pskip is already there, should I remove it also?

Thanks a lot, Asmodian

sneaker_ger
28th November 2012, 13:44
Fighting banding in 8 bit H.264 is really hard. Try a forum search:
http://forum.doom9.org/showthread.php?t=164352

mp3dom
28th November 2012, 14:00
CG and animation, in general, are prone to banding. To avoid banding, you need huge amount of bitrate. 2Mbps are not enough. Depending on your footage, you can have banding even at crf10 or at full bluray bitrates (~30/35 Mbps average). You can help the encoder if you add some 'grain' in those particular parts but still, you need higher bitrate. Anyway, you're making 720p files from 1080p MKVs (that are already at low bitrates, you said ~10 Mbps 1080p). Why don't you directly use the bluray M2TS as a source?

raiden2k5
28th November 2012, 20:11
CG and animation, in general, are prone to banding.
Hi, Mp3dom.
I tried with a CG movie and it worked really well. I might have occasionaly a slight banding/ringing for a second or two. I think this is ok and barely noticed. Have to try with a second movie to see what happens.
On film I get a lot of compression (small file size) and awesome results as well in terms of image fidelity regarding the original source.
The problem is that these settings won't work as desired for every single MKV I have. Some are great, some just aren't. :scared:
I think I am not passing any bitrate limits to x264.exe so I am letting it decide how to handle data and use whatever bitrate it finds necessary.
I have encodes with as little as 2.400Kbps and others @4.500Kbps. It decides what to use and still I am having video tracks with 1.8GB to 4GB in size, and I'm good with this.
Like you, I also suspect that the issue might be related to the source bitrate being too low on some of them.
The odd thing is that I managed to get video streams @2.400Kbps that look better than others with @4.000, how come!?!? :mad:
Right now I can't access m2ts (BD structure) because I don't have a computer bluray. Currently I have an LG 3D Bluray, living room type. I am saving for a new computer Ci7 based so now I don't really want to spend €100+ on a PC BD player/recorder.
Thus I am fetching the files from the net instead and learning in the process until I master it and get a BD for PC.
With DVDs there's no problems. Obviously I have a compatible drive in my laptop.
You said that I can improve it by adding som 'grain' but it'll raise the bitrate. What's the option for that (remember I am using x264 command line)? I don't mind adding a bit on the file size/encoding time as long as it does the trick.

Asmodian, nevertheless, I'll drop it to 17.5 and remove --nr=100 as suggested.

As for B-frames, I thought that we should use as many as possible?? I'll give it a shot with spline (I chose Lanczos4 because I didn't want it to look blured).

sneaker_ger, I can't use 10bit cuz it won't be played by my media players. I am not using VLC for that. I promisse I'll fully read that thread as soon as possible. Thank you.

Ok, guys. Need to attend to family matters. Thanks for the good help here.

Keep it up. :thanks:

raiden trad

raiden2k5
28th November 2012, 20:23
You could try lots of things but as you have a pretty detailed command line I assume you picked these options for a reason. :)

Yep. I read and read and read... as I wanted the best settings for the best image quality/file size! :)

Thanks!

Guest
28th November 2012, 21:25
Thus I am fetching the files from the net instead and learning in the process until I master it and get a BD for PC. Closing thread for rule 6 violation. Please read and follow our forum rules.

http://forum.doom9.org/forum-rules.htm