View Full Version : Getting the darn ">" to dump the -v output
benwaggoner
25th February 2013, 19:22
Running x264.exe on Windows.
I want to capture the frame-by-frame info that gets sent to the console when running with -v.
DOS being DOS, I'd use the ">" operator to dump to a text file.
Which works totally fine if I do
"x264.exe --longhelp>x264_2245_longhelp.txt"
I get the whole longhelp in a nice .txt file.
But if I'm doing it in an actual encode, ala:
x264.exe -o "TearsOfSteel.mp4" TearsOfSteel_1920x800.avs -v>TOS_output.txt
Everything gets dumped to the console as normal, and I wind up with a 0 byte TOS_output.txt file.
I don't know if this is a x264 thing or just a "Ben doesn't know from .bat" thing. Any suggestions?
JEEB
25th February 2013, 19:30
x264_cli_log() outputs to stderr, not stdout. Thus 2> is needed, not > :)
MasterNobody
25th February 2013, 19:30
You need to redirect stderr output with "2>" instead of redirecting stdout with ">" which is equal to "1>".
benwaggoner
26th February 2013, 04:50
Thanks guys!
Once again, I am reminded I have apparently become an old fart and learned scripting on VMS, not DOS or UNIX.
Selur
26th February 2013, 15:38
just for completeness:
x264.exe -o "TearsOfSteel.mp4" TearsOfSteel_1920x800.avs -v 1> TOS_output.txt 2>&1
would allow to capture cerr and cout at the same time. :)
Groucho2004
26th February 2013, 15:55
just for completeness:
x264.exe -o "TearsOfSteel.mp4" TearsOfSteel_1920x800.avs -v 1> TOS_output.txt 2>&1
would allow to capture cerr and cout at the same time. :)
The streams are called stderr and stdout. You're writing too much C++. :D
benwaggoner
26th February 2013, 17:42
Well, the map of my ignorance is getting larger at least :).
How could I get the output saved to the .txt file AND show some status to the screen (either the full verbose or just the standard)?
Groucho2004
26th February 2013, 18:01
How could I get the output saved to the .txt file AND show some status to the screen (either the full verbose or just the standard)?
Not possible unless you have a launcher that captures (redirects) x264's output, displays it and writes to a file at the same time.
I think Lord_Mulder wrote a tool for that some time ago.
Edit:
Search for StdOut/StdErr Logger on this (http://mulder.brhack.net/) page.
MasterNobody
26th February 2013, 18:06
if you have "tee" util (from msys or your on linux) than you can write:
x264 ... 2>&1 | tee log.txt
vdcrim
26th February 2013, 18:26
I use this implementation of tee (http://www.commandline.co.uk/mtee/) [EDIT] together with this one of sed (http://sed.sourceforge.net/grabbag/ssed/) to get rid of the progress report.
x264 2>&1 | sed -u -e "/%.\+frames.\+fps.\+eta/d" | tee "log.txt"
If I remember well the lines logged may appear in a different order because stderr is flushed immediately.
filler56789
27th February 2013, 01:29
DOS being DOS, I'd use the ">" operator to dump to a text file.
All those years working @ Microsoft, and still, you haven't learned there is NO *real DOS* under a 32-bit Windows environment? ;)
Long live Windows 4.00.950 !! :) :p :D
benwaggoner
27th February 2013, 05:17
All those years working @ Microsoft, and still, you haven't learned there is NO *real DOS* under a 32-bit Windows environment? ;)
Long live Windows 4.00.950 !! :) :p :D
Well, let's just say it's an all too faithful emulation of DOS :).
For me, DCL is the one true shell!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.