Page 1 of 1

manipulating the command line code using java

Posted: 27 Jun 2007 04:29
by developprograms
I have tried to copy and paste the command line options that are shown at this site

http://www.videolan.org/doc/streaming-h ... l#id294897

for the rtp streaming in java. However when I either copy and paste the options into the command line or try to do this in java code

try {
String[] file = {"cmd","% vlc -vvv input_stream --sout '#rtp{dst=192.168.0.12,port=1234,sdp=rtsp://server.example.org:8080/test.sdp}'",};
Process p = Runtime.getRuntime().exec(file);
} catch (IOException ex) {
ex.printStackTrace();
}

I am not able to come up with anything. I get an error that states % is not recognized as an internal or external command, operable program or batch file.

Possibly I am doing this wrong, but am unsure how to manipulate vlc using the command line. If someone could point me to a tutorial or give me information on how to do it, it would be excellent. I have looked over the website and haven't found what I am looking for and possible looked over it.

Thanks for your help

Re: manipulating the command line code using java

Posted: 27 Jun 2007 14:41
by 3breadt
This should work:

Code: Select all

String[] file = {"vlc.exe","-vvv","input_stream","--sout","#rtp{dst=192.168.0.12,port=1234,sdp=rtsp://server.example.org:8080/test.sdp}"};
You have to seperate the different parts of the command line. Each space you would have in the command line is a seperator, except when it is inbetween quotes, like it is the case with the #rtp... command in this example.

e.g. to start VLC in Skins2 mode and to load the file C:\Documents and Settings\User\My Documents\file.ext the commandline would be

Code: Select all

vlc.exe -I skins2 "C:\Documents and Settings\User\My Documents\file.ext"
The according java array would be

Code: Select all

{"vlc.exe","-I","skins2","C:\\Documents and Settings\\User\\My Documents\\file.ext"}
Hope you understand.

Re: manipulating the command line code using java

Posted: 28 Jun 2007 18:56
by developprograms
Thanks much for your help. I was confused on the use of the command line initially, but I understand the use of it now.

Thanks for your help.