manipulating the command line code using java

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
developprograms
Blank Cone
Blank Cone
Posts: 16
Joined: 27 Jun 2007 01:43

manipulating the command line code using java

Postby developprograms » 27 Jun 2007 04:29

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

3breadt
Big Cone-huna
Big Cone-huna
Posts: 827
Joined: 19 Mar 2006 11:37
Operating System: Win7 Pro / OS X 10.7
Location: Paderborn, Germany
Contact:

Re: manipulating the command line code using java

Postby 3breadt » 27 Jun 2007 14:41

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.
-- 3breadt (aka altglass)

developprograms
Blank Cone
Blank Cone
Posts: 16
Joined: 27 Jun 2007 01:43

Re: manipulating the command line code using java

Postby developprograms » 28 Jun 2007 18:56

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.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 14 guests