Salve
Sto provando di dividere un video in frame usando le librerie JMF.
Ho trovato molte soluzioni in rete ma ognuno di loro si blocca sempre nella stessa linea di codice....posto un piccolo esempio per capire:

Con questo creo il player e FrameGrabbingControl
codice:
MediaLocator ml;
		if ((ml = new MediaLocator("file:C:\\why.mov")) == null) 
			System.out.println("Cannot build media locator from: "+url);
		
		DataSource ds = null;
		// Create a DataSource given the media locator.
		try {
		ds = Manager.createDataSource(ml);
		p = Manager.createPlayer(ds);
		p.start();
		} catch (Exception e) {
			System.out.println("cannot create DataSource from "+ ml);
			System.out.println("player non creato");
		}
		
		frameGrabber = (FrameGrabbingControl) p.getControl("javax.media.control.FrameGrabbingControl");
E fino qua tutto bene. Arrivato il momento di creare il buffer per poi salvare l'immagine, mi restituisce l'eccezzione di java.lang.NullPointerException.

codice:
     Buffer buf = frameGrabber.grabFrame();
		// Convert frame to an buffered image so it can be processed and saved
		Image img = (new BufferToImage((VideoFormat) buf.getFormat()).createImage(buf));
		buffImg = new BufferedImage(img.getWidth(this), img.getHeight(this),BufferedImage.TYPE_INT_RGB);
Per caso ho bisogno di permessi?? non capisco perchè nn crei il buffer.

Grazie