I'm trying to feed FFMPEG with certain bytes with the pipe operator in cmd via a Java application which should send those bytes to the stdout, but when I try to do so and proceed to testing Eclipse freezes as the console is constantly full of bytes.
I've tried hiding all that output by clicking the button which doesn't refresh the console when stdout changes, but even after doing so the bytes keep appearing sometimes and the application keeps freezing.
This is the code which is generating the problems.
static PrintStream stdout = new PrintStream(System.out);
(...)
try {
line = (TargetDataLine) mixer.getLine(info);
line.open(format);
ByteArrayOutputStream out = new ByteArrayOutputStream();
int bytesRead, CHUNK_SIZE = 4096;
byte[] data = new byte[line.getBufferSize() / 5];
line.start();
while (true) {
bytesRead = line.read(data, 0, CHUNK_SIZE);
line.read(data, 0, CHUNK_SIZE);
stdout.write(data, 0, bytesRead);
}
Is there any workaround for this kind of problem?