0

I'm trying to wrap a commandline program with a java gui (x264) but I'm having difficulty getting the output stream. I have already tried the solution posted here:

java runtime.getruntime() getting output from executing a command line program

This works when I run x264.exe --help. I am able to read the help outputted by x264, but when I actually encode a video it does not get any output until the encoding is finished. I would like to be able to get the output while it is running so I can track the percent finished of x264.

Community
  • 1
  • 1
Gink
  • 1
  • 1
  • Probably you are running the code in your main thread so that it is not updated while it is busy after processing is finished it updates the thread at once at last try to implement threading – Zain Ul Abidin Oct 31 '16 at 05:37
  • Try running x264 with the `--progress` option. Many command line applications disable their progress output when their standard output is not connected to a tty (when you run it like this, the x264 standard output is connected to a pipe). Using the `--progress` option will likely override that logic and turn it back on. – Erwin Bolwidt Oct 31 '16 at 05:41

1 Answers1

0

After trying numerous things, I fixed it by getting output from stderr instead of stdout. For some reason x264 outputs progress reports through stderr.

Gink
  • 1
  • 1