tags:

views:

17

answers:

1

Hi all

I want to run a program called VLC in java. I created it's process by Runtime. I don't know how to pass commands to this process. Also VLC program can be controlled via command line. I want to set a Port and IP address to VLC program listen to streaming data. Every process in java has InputStream and OutputStream.

        Runtime rt = Runtime.getRuntime();
        Process p = rt.exec("C:\\Program Files\\VideoLAN\\VLC\\vlc.exe");
        DataInputStream in = new DataInputStream(p.getInputStream());

        OutputStream out = p.getOutputStream();

thank you, sajad

+2  A: 

Javadoc is your friend : http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Runtime.html#exec(java.lang.String[])

There is a version of exec which accepts a String array for the command and its arguments.

Peter Tillemans