Sounds like you're not actually passing an argument to the program, which it expects from this line:
String media = args[0];
If you don't want to pass an argument, just change it to:
String media = "(location of rtsp to stream)";
...and delete the if statement above it as you already have.