Log in

View Full Version : Please help me set appropriate x264 settings.


junglemike
10th April 2009, 21:15
Hello fellas. You've helped me a lot before. And thank you for that.

I am trying to compress videos off my camcoder from Mpeg-2/AAC format to x264/ogg(or aac)/mkv format.
The problem is that I have a lot of files (around 840) and i'm trying to precess all of them at once.

This is what I've already managed to do:
1) I demuxed all audios (ac3) using command-line of DGIndex and created .d2v files for all 840 videos.
2) Using simple dos command "for %f do...." I created .avs scripts for all 840 files. my typical strips looks like this:
LoadPlugin("c:\progra~1\Gordia~1\DgmpgDec\Dgdecode.dll")
LoadPlugin("c:\progra~1\Gordia~1\AvisynthPlugins\Undot.dll")
LoadPlugin("c:\progra~1\Gordia~1\AvisynthPlugins\TomsMoComp.dll")
Mpeg2source("mov00375.vob.d2v")
TomsMoComp(1,5,1)
crop(0,0,720,576)
LanczosResize(576,320)
Undot()
3) I've also batch encoded audio's so they are ready to mux
4) I <probably> will manage to batch mux the x264 with ogg into mkv's for all 840 files.

This is where I need your help please
For single file encodes I usually use Megui with unrestricted 2 pass hq preset and it works great.
But searched and found no way to batch process all 840 .avs scripts with Megui, so I'll probably have to do this with command line x264.exe with appropriate parameters. I want and average 1200kbps for an output files. Hence couple of questions:

Question 1)
Is it possible to process both 2 passes with only one single dos command? (like x264.exe .... bla bla bla...) that would give me an ready .264 file? If yes, than how?
Question 2)
Can I use a presets from Megui, and somehow pass it as a parameter to x264.exe? If yes, than how? If no, what would be equivalent of the specific preset when in various parameters, that i pass to x264.exe?
Question 3)
This is more general question that would help me understand what's going on. There is constant quality 1 pass preset in Megui. Is it better than 2-pass? What i mean is this: for example I encode some video with "unrestricted 1 pass constant quality" preset and get a result which is, say, 700mb. Now I encode same video with preset "Unrestricted 2 pass HQ" and as a desired size, I choose 700mb. Will second video be of better quality? and why?

J_Darnley
10th April 2009, 21:37
1 - Didn't I already show you this?
FOR %A IN (*.mod) DO (
x264 [options] --pass 1 "%~A" -o NUL
x264 [options] --pass 2 "%~A" -o "%~nA.264"
)

2 - Yes, MeGUI lets you see the cmd line it creates in the settings window

3 - x264's crf rate-control mode produces, on average, the same quality as two-pass at the same bitrate. Search if you want to know what benefits the two have.

junglemike
10th April 2009, 23:57
J_Darnley, Thanks, I'm already trying now with crf option in batch mode.
I've read the profile explanation faq, and understood somewhat more about the profiles.
I have a question though. Looks like you are have deep knowledge in this field, so maybe you can advice me.

I found that when i use --crf option (in my case --crf 22) for my batch of files - resultring bitrate extremely vary. For example some files receive 1900kbps, while other receive 500kbps.
Is --crf more "clever" method to use in my case than 2 pass target bitrage(or size)??
I have bunch of files shot with same camera with verying length, and verying content type, some are more static, some arent. I'm not trying to hit partiqular size etc. I just want to reduce the huge initial size (40gb) to burn them to dvd('s) and to be able to send some of them over the internet.
What do you say?

Rumbah
11th April 2009, 03:27
If you don't need to hit a certain file size cfr is the way to go. If you like crf 22 then encode with it. The files with more action get a higher bitrate than static ones. The files get as much bitrate as needed to match your crf value.