I have a Java application that I've developed to view/control video. I use VLC as the video software decoder and so far it's worked really well (I've looked at jVLC but that just wasn't going to work for this application). One issue, however, is that VLC consumes a lot of CPU when I start it using Java and Runtime.exec(). In particular, I have something similar in my current setup (this is from memory so it may not be 100% correct):
Code: Select all
System.getRuntime().exec("C:\Documents and Settings\d.irwin\VideoLAN-0.8.6d\VLC\vlc.exe -I telnet --telnet-host 192.168.0.72:4212 -I rc --rc-host 192.168.0.72:4214 --video-title /"Video Title [192.168.0.72:4212]/"");
Note: VLC consumed 50% CPU both before and after I created the process handler/stream reader so that didn't really make any difference.
Any suggestions? This is really causing a problem on some slightly older computers that really chug along when they actually start to decode live video.
Thanks,
Dave
Java 1.5+ on Windows XP with VLC 0.8.6d+
========================================
A little more research done. I found that the following works fine in that it doesn't cause any high CPU consumption:
Code: Select all
private final String vlcPath = "C:\\Documents and Settings\\d.irwin\\VideoLAN-0.8.6d\\VLC\\vlc.exe";
private final String[] args = { vlcPath, "-I", "telnet", "--telnet-host", "192.168.0.72:4212" };
...
try {
Runtime.getRuntime().exec(args);
} catch (IOException ioe) {
System.err.println("IO exception: " + ioe.getMessage());
}
Code: Select all
private final String vlcPath = "C:\\Documents and Settings\\d.irwin\\VideoLAN-0.8.6d\\VLC\\vlc.exe";
private final String[] args = { vlcPath, "-I", "telnet", "--telnet-host", "192.168.0.72:4212",
"-I", "rc", "--rc-host", "192.168.0.72:4214" };
...
try {
Runtime.getRuntime().exec(args);
} catch (IOException ioe) {
System.err.println("IO exception: " + ioe.getMessage());
}