Я предполагаю, что это как-то связано с вашей установкой JMF. Вы используете Windows? Если это так, я переработал ваш код. Дать ему шанс. Он сообщит вам, находятся ли dll, необходимые для воспроизведения видео, в правильных местах.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication13;
/**
*
* @author dvargo
*/
import javax.media.*;
import javax.media.format.*;
import java.io.*;
import java.util.*;
public class Test {
final static String windowsDllFolder = "C:\\WINDOWS\\system32\\";
final static String[] windowsDllList = new String[]{
"jmacm.dll",
"jmam.dll",
"jmcvid.dll",
"jmdaud.dll",
"jmdaudc.dll",
"jmddraw.dll",
"jmfjawt.dll",
"jmg723.dll",
"jmgdi.dll",
"jmgsm.dll",
"jmh261.dll",
"jmh263enc.dll",
"jmjpeg.dll",
"jmmci.dll",
"jmmpa.dll",
"jmmpegv.dll",
"jmutil.dll",
"jmvcm.dll",
"jmvfw.dll",
"jmvh263.dll",
"jsound.dll"};
/**
* Verifies that all the dll's that JMF needs are in their correct spot
* @return True if all dlls are in their correct spot, false otherwise
*/
public static boolean detectDlls()
{
boolean retVal = true;
String currFile;
for(String currDll : windowsDllList)
{
currFile = windowsDllFolder + currDll;
if(! new File(currFile).exists())
{
retVal = false;
}
}
return retVal;
}
public static void main(String a[]) throws Exception {
boolean JMFsetUp = detectDlls();
if(JMFsetUp == false)
{
System.err.println("Missing DLLS");
}
else
{
System.out.println("JMF Should be working");
}
CaptureDeviceInfo di = null;
Player p = null;
Vector deviceList = CaptureDeviceManager.getDeviceList(new AudioFormat("linear", 44100, 16, 2));
if (deviceList.size() > 0) {
di = (CaptureDeviceInfo) deviceList.firstElement();
System.out.println((di.getLocator()).toExternalForm());
} else {
System.out.println("Exiting");
System.exit(-1);
}
try {
p = Manager.createPlayer(di.getLocator());
} catch (IOException e) {
System.out.println(e);
} catch (NoPlayerException e) {
System.out.println(e);
}
System.out.println("Playing Started");
p.start();
}
}