Log in

View Full Version : New to h.264 encoding, could use help / advice


chilledinsanity
28th October 2011, 15:46
I've had a lot of experience encoding in Xvid, but I'm trying to transition to x264 encoding in MKV and I really don't understand a lot of the options I'd be tweaking. I'd rather ask people who know what the hell they're doing for advice on what settings / software I should use.

I create my own videos (RGB source) and want advice on software / settings I should use. I have two basic profiles I want to get settings for:


1. Distributing videos:

I want to have high quality for the space, but also semi-decent compatibility for playback on computers. While I use MPC-HC with MadVR, I still have to be prepared for many of my audience using VLC Player, so I want to minimize the artifacts that show up. I definitely want a quality based encoding, as opposed to a flat bitrate, but beyond that, I'm not sure what I should be doing or what settings I should be paying attention to. So far I've tried using Handbrake and while the results were pretty abysmal using "Normal", they seemed decent enough using "High Profile." Should I stick with this or is there better software I should be using?


2. Archiving:

I want to archive these videos in case I want to come back to them for the future for editing or re-encoding. I'm not so extreme that I want to go lossless, but I want the quality to be extremely high and it can take up much more space than normal. I have no idea what software / settings I should be using for this.


Thanks in advance for any help you can give me, the more details the better.

hello_hello
30th October 2011, 09:17
I prefer MeGUI over Handbrake but it's all personal preference.
Single pass CRF encoding with a CRF value of 18 is supposed to be transparent. The lower the value, the higher the quality, so you could go down to a CRF value of 16 if you don't care about the file size so much.

I don't know about Handbrake, but MeGUI has a target device option when setting up the x264 encoder. I don't actually use it because I encode for Bluray player compatibility, and the Bluray target device option sometimes enforces Bluray pixel aspect ratios when encoding (it's a long story but when encoding to an MKV or MP4 container you don't always want that) so I added the rest of the appropriate Bluray settings manually. Any of the target device options should allow you to play the file on a PC, even using VLC. If all you're worried about is PC playback, then the DXVA target device option is probably the one to use.

This is the command line I use for Bluray player compatibility for HD stuff:
program --level 4.1 --tune film --crf 19.0 --keyint 24 --open-gop --b-pyramid strict --ref 4 --slices 4 --vbv-bufsize 30000 --vbv-maxrate 40000 --aud --nal-hrd vbr --colorprim bt709 --transfer bt709 --colormatrix bt709 --output "output" "input"

This one for standard definition (NTSC):
program --level 4.1 --tune film --crf 19.0 --keyint 24 --open-gop --b-pyramid strict --ref 4 --slices 4 --vbv-bufsize 30000 --vbv-maxrate 40000 --aud --nal-hrd vbr --colorprim smpte170m --transfer smpte170m --colormatrix smpte170m --output "output" "input"

If you give MeGUI a shot you'll see how the command line changes according to the target device option or any other x264 settings you change. I just copied and pasted the above from my MeGUI encoder presets. Have a play around with it, and I guess post back if you have any questions.

There's a little bit of a learning curve with MeGUI, but it's worth it as it's a good program. I never could get my head around Handbrake.... but maybe that's just me.