PDA

View Full Version : Automated x264 CLI Encoder (with vars)


Tartz
13th August 2008, 21:24
Hi guys.

First of all, I’m totally new on this forum and an encoder newbie so excuse me for any mistakes.

I've done some research in x264 encoder and found out I needed to use MeGui or CLI.
Since I’m kind of a geek CLI had my preference.
I noticed the many steps it takes to start converting a video, so I created a batch.

This batch does the following things:
- Scan input file (location given in the commandline) and generates a stats file which contains all the video specifications, using Mplayer
- Calculate aspect ratio (using vars given in the commandline and stats file from Mplayer) and FPS
- Encode audio using Nero AcEnc
- Encode video using x264 and predefined parameters (2pass)
- Create Mp4box
- Output the video (location given in the command line)

This batch is very useful for people who want to automate their encoding.

Everything is in the .rar file except AviSynth.
This needs to be installed before the batch works.

The .bat file uses the following parameters:
b_encode.bat InputFilename+ext OutPutFilename SizeX SizeY

E.g.:
b_encode.bat input.avi my_output 800 600

All the input files need to be in the input folder.
Output goes to the output folder

I hope you guys find it useful too.

Download link:
http://rapidshare.com/files/137104844/Encoder.rar



I would also really appreciate some help in the x264 parameters.

I currently use the following code for all video's:
--bitrate 1200 --qcomp 7 --stats "temp/input.stats" --ref 6 --bframes 3 --b-pyramid --weightb --direct auto --filter 1:1 --analyse all --8x8dct --subme 6 --me umh --trellis 2 --progress --threads auto --no-psnr --no-ssim --thread-input --output "temp/video.264" "input.avs"

Which gives about 10 mb / minute files at high quality.
If anyone has some pointers in keeping this quality but with less MB's/minute it would be very appreciated.

Sagekilla
14th August 2008, 04:44
Easy, incease subme to 7, use b-rdo, bime, and mixed refs. That should increase compression at the cost of speed.

bob0r
14th August 2008, 08:33
--filter 1:1, can be removed, i think the default is just fine.
--qcomp 7, why use that? Remove it and let AQ do its job.

If this is something people want, ill put the file on a mirror.
Next time use version numbers in the filename! :)

audyovydeo
14th August 2008, 10:13
Good initiative !

I also use a set of batch files under windows, to automate operations to a maximum. Works as follows :

Usage :
x_av profile mode crf sar video audio [shutdown]
... or ...
x_wrap profile mode crf sar directory\*.avi [noaudio / same] [ td ]
... or ...
x_av profile mode crf sar video estimate


profile : base, main, high, [ intra ]
mode : fast, good, best, blast, [ none ]
sar : 11 43 54 169 6445 3227
video : .avi or .avs
audio : noaudio, audiosource.avi, same


You'll surmise that I *only* use crf. I used to support the other modes but I never used them so dumped them.

x_wrap is a "wrapper" to the main batch that allows to specify a directory, rather than a single file, and optionally passes a "deinterlace" parameter to the avs script.
I use it when I want to encode quick'n'easy the whole bunch of DV files captured from my camcorder.

My scripts use / require :

cygwin
mp4box
avi2wavcmd
(optionally wavi)
neroAacEnc_SSE
avisynth (optionally TDeint)

if anyone's interested, say so or PM me.

cheers
audyovydeo

Tartz
14th August 2008, 12:45
Thanks for the pointers
Also thanks for the support on the x264 script ;)

@ Audyovydeo
That seems like a good idea!
I might incorporate the same multiple file batching idea in mine :)