View Single Post
Old 20th May 2008, 06:24   #2  |  Link
refulgentis
Registered User
 
Join Date: Apr 2008
Posts: 56
Quote:
Originally Posted by Puu View Post
hello
I have got the following settings:



I'd like to implement them into a batch file to encode x264 files. The bad thing is just, that i dont have any idea how the encoding works, so i have no idea what the batch file has to look like.

Would be great if someone of you could help me here.

Greets
Puu
from another forum I'm on, using mplayer to pipe video to x264:
Quote:
Originally Posted by deebo
Not meant to be exhaustive in any way, I was just testing some encoding on linux since i have a spare dualcore server.
It worked fine, cant tell the difference to average windows avisynth based encode, and as a bonus my desktop
computer is no longer at 100% cpu 24/7

I'll try to do some of that SH magic and make the script a bit interactive (naturally its easier to do some other stuff
on windows, like bitrate calculations with evodemux etc methods). Like source, codec types, fps, etc parameters!

Heres a simple sh script i use to encode

Quote:
[pre]
#!/bin/sh

#source for pass 1
mplayer -really-quiet -demuxer lavf -vc ffvc1 -nosound -fps 23.976 -sws 10 \
-vf crop=1912:1072,scale=1280:720 -vo yuv4mpeg:file=video.y4m video.EVO &

#x264 for pass 1
x264 --pass 1 --bitrate XXXX --stats ".stats" --bframes 3 --b-pyramid --direct auto \
--deblock -3:-3 --subme 1 --analyse none --me dia --threads auto --cqmfile "prestige.cfg" \
--progress --no-psnr --no-ssim --output /dev/null video.y4m

#source for pass 2
mplayer -really-quiet -demuxer lavf -vc ffvc1 -nosound -fps 23.976 -sws 10 \
-vf crop=1912:1072,scale=1280:720 -vo yuv4mpeg:file=video.y4m video.EVO &

#x264 for pass 2
x264 --pass 2 --bitrate XXXX --stats ".stats" --ref 5 --mixed-refs --no-fast-pskip \
--bframes 3 --b-pyramid --b-rdo --bime --weightb --direct auto --deblock -3:-3 --subme 7 \
--analyse all --8x8dct --trellis 1 --aq-strength 0.3 --me umh --threads auto \
--cqmfile "prestige.cfg" --progress --no-psnr --no-ssim --output encode.mkv video.y4m
[/pre]
What do you need?
- mplayer (build it yourself to get all the fancy features)
- x264 (i built it myself to get the adaptive quants patch)

What do you need to do?
- create a sandbox for your encodes "mkdir /whatever/wherever"
- create a named pipe for mplayer output where x264 can read from
Quote:
[pre]
# mkfifo video.y4m
[/pre]
Setup mplayer pipe output
- find out how to decode your source with mplayer, im using a .evo so i need a specific demuxer "-demuxer lavf", the .evo contains vc1 so i need the wvc1 codec "-vc ffvc1"
- set fps "-fps 23.976"
- set output, x264 accepts yuv2 or yuv4mpeg so we use "-vo yuv4mpeg:file=video.y4m" so mplayer decodes to the fifo pipe we created
- filter how you see fit, in the example i crop 4 pixels from every direction "-vf crop=1912:1072" with a software spline scaler "-sws10", and i also scale the resulting video to 720 ",scale=1280,720"
-- (note that by default the crop filter crops around the edges, you can set the crop point with "crop=1912:1072:x:y" where x and y are the coordinates, see manual for more info)
-- see manual for more video filter info

Setup x264
- do it like you would in windows, nothing to it

NOTE! you have to output the video twice to the pipe, once for each pass as each pass exhausts the pipe. mplayer just plays the video into the pipe

Leave any tips and criticism in the thread!
refulgentis is offline   Reply With Quote