View Full Version : How to get output of X264?
huang_ch
13th August 2006, 03:07
I'm writing some batch file to encode with x264, but I found it's hard to get output from x264 such as PSNR result or FPS, if I use "x264.exe <options> > output.txt", the output.txt just kept zero length after encoding finished. Anyone know any method to get the output from x264? Thanks.
foxyshadis
13th August 2006, 04:03
x264 2>output.txt
or
x264 2>&1 >output.txt
to capture both output streams.
huang_ch
13th August 2006, 08:11
x264 2>output.txt
or
x264 2>&1 >output.txt
to capture both output streams.
Thanks for your help. I've tried that the first one works, but it doesn't print anything on console, all are redirectly to output.txt, is there a way to get it both print on console and output.txt?
And the 2nd command line doesn't work, it still doesn't redirect to output.txt, and what do you mean by capure both output streams?
Also, could you please explain in more detail about why put an extra "2" at the end of command line would help? and what the "&1" means? I'm not familiar with these. Thanks.
foxyshadis
13th August 2006, 13:25
Well, I made the other up by memory. It should have been
x264 >output.txt 2>&1
sorry. The 2 means stderr, the 1 is stdout. x264 prints everything onto stderr, so you have to capture and redirect that stream.
But to both display and capture it is not simple. You would need to pipe it through another program specifically for that purpose, unless there's some redirection trickery I'm not familiar with.
huang_ch
14th August 2006, 06:17
Thanks foxyshadis~~~~
virus
18th August 2006, 13:17
But to both display and capture it is not simple. You would need to pipe it through another program specifically for that purpose, unless there's some redirection trickery I'm not familiar with.
Under win32, if you use MSYS this should work:
x264 2>&1 | tee output.txt
(IIRC MSYS includes a port of the standard Unix "tee" util)
I'm not aware of any way to do it under winXP's joke of a shell.
huang_ch
19th August 2006, 02:33
Thanks virus, I'll try MSYS. :)
foxyshadis
19th August 2006, 03:39
<nm then>
huang_ch
19th August 2006, 08:40
Thanks foxyshadis, I've done with my batch. :)
But I still have to install the msys package to get some files under etc folder to run with your tee package, otherwise it just return immediately and did nothing.
MeteorRain
21st August 2006, 02:49
so, huang, do you really need to print the message on a console as well as into a file?
if you are making a tool why not intergrate the progress bar in you tool? (just guess ^ ^
huang_ch
21st August 2006, 05:43
to MeteorRain, I'm not making a tool, just making a .bat file to do the batch encoding. :)
MeteorRain
21st August 2006, 06:00
ok. i'm not sure if it needs any package but tee.exe should be a stand alone tool
afaik it only imports some functions from msys-1.0.dll ~_~
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.