This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Redirecting process output as an input to another command with Apache Commons Exec

Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been struggling with this problem for quite some time now as it's my very first time doing an application related to streaming and I just can't figure out why. Here's the problem...

What I'm trying to achieve is to send a command's output as an input for the next one, which is basically what the pipe operator does. As I knew this couldn't be executed directly with Exec library from Apache Commons I started looking for ways to solve this. I've seen quite a few examples of similar things to this but none of them covers my situation:

I have two Java applications separated, one is the main application and the second one is initialized by the first one. This second applications sends to the Standard Output bytes, which FFMPEG should receive.

My current workaround to this problem is the following one. (Related parts of the problem are below.)

As is modified twice during execution time, what I did was to instantiate another (executorFFMPEG) to see if processing separatedly both commands was the solution to this, but it seems that I'm not getting anything from that workaround neither.

Then, who sends the bytes? This is the piece of code which sends them (), which basically is an indeterminate amount of bytes.

(more code and other things around here)

At the moment, no communication seems to be made between both commands as ffmpeg isn't receiving anything.

Hope you guys can tell what I'm missing out, or if I'm incorrectly working with the Apache Commons Exec library thinking it works in a way when it works in another one.
Can't .... do .... plaid .... So I did this tiny ad instead:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!