Log in

View Full Version : Getting encoding results in a text file


jpsdr
3rd April 2010, 12:32
I've searched in the help, but found nothing.

Is there a way to have the encoding results be put in an output file ?
I've try : x264.exe [skip cmd lines] > out.txt
but it didn't work, my txt file is 0 byte in size.

Thanks.

Boolsheet
3rd April 2010, 12:55
Lookup I/O Redirection.

x264 prints its info to stderr. stdout is used for piping the output stream. To redirect stderr to a file use:

x264.exe [skip cmd lines] 2> out.txt

You might want to disable the progress info while redirecting to a file, because every line (and that means every progress update) gets written to it.
Maybe someone else knows how to get around that.

kemuri-_9
3rd April 2010, 14:38
x264.exe [skip cmd lines] 2> out.txt

You might want to disable the progress info while redirecting to a file, because every line (and that means every progress update) gets written to it.
Maybe someone else knows how to get around that.

this largely depends on how you want it to work:
A) if you're ok with not being able to see the progress indication while it's encoding then that's one thing
B) but if you only want the final encoding results to a text file that's a different thing (e.g. batch encoding).

which one are you looking for specifically?

jpsdr
3rd April 2010, 15:44
I don't know what's possible. The ideal for me would be to be able to see progress indication while encoding, and having the final encoding in a text file.
If i use --no-progress, in my text file, using the 2>out.txt, i'm having only the result, but i'm unable to see the progress (i don't know if it'll be finished in 5min or 10hours). Without the --no-progress, i'm having all the progress output in the file.
So, if possible, i want the final results in a text file, without the progress, but beeing able to monitor the progress.

kemuri-_9
3rd April 2010, 17:58
this is the more complicated choice.
when i wanted to do something like this before I usually found myself doing something like the following:

x264 [opts] 2>&1 | tee out_a.txt
cat out_a.txt | tr "\r" "\n" | grep -v "\(eta\|^$\)" > out.txt
rm out_a.txt


someone could probably come up with something better, but this worked good enough for me.

jpsdr
4th April 2010, 08:38
Thanks, i'll try this.

Dark Shikari
4th April 2010, 08:53
If you're on windows, the progress will be printed to the title bar even if you pipe it to a file ;)

jpsdr
4th April 2010, 08:59
Yes, i've noticed that.

jpsdr
4th April 2010, 09:16
Don't work : error message saying 'tee' is an unknow command...

Ok, it's seems to be for linux, so, unfortunately not for me (cat, grep are unknow on windows...).

Dark Shikari
4th April 2010, 09:37
Don't work : error message saying 'tee' is an unknow command...

Ok, it's seems to be for linux, so, unfortunately not for me (cat, grep are unknow on windows...).Nobody says you can't install a real shell on Windows (e.g. Cygwin).

Blue_MiSfit
4th April 2010, 10:50
Cygwin is indeed very cool stuff. I'd suggest you try it...

~MiSfit

dvy
4th April 2010, 10:58
On windows You can do it like this :

x264.exe [skip cmd lines] > out.txt 2>&1


after do above,like Dark Shikari say,the progress will be printed to the title bar and x264 info dumps into out.txt.:)

J_Darnley
4th April 2010, 11:09
Don't work : error message saying 'tee' is an unknow command...

Ok, it's seems to be for linux, so, unfortunately not for me (cat, grep are unknow on windows...).

Install them then, you don't even need cygwin!
http://gnuwin32.sourceforge.net/

jpsdr
4th April 2010, 14:50
Thanks for all these informations. I think i'll stay with a file containing all the encoding log, i'll clean up manulay after.

kemuri-_9
4th April 2010, 14:58
on windows,
cat can be replaced with type
grep can be replaced with findstr, though you'd need to tweak findstr some.
you'd still be missing tr and tee though for cmd,
if you're using PowerShell instead of cmd, you'd only be missing tr (since it has tee it seems)...