Si,hai ragione
Dovevo postare anche il resto.In sostanza ho fatto in modo che ogni 64 foto venga creata una nuova cartella.Ed i file li ho chiamati 01.jpg,02.jpg e così via...
codice:
if (source==grabButton)
{
JFileChooser finestra= new JFileChooser();
finestra.setDialogTitle("Salva Files");
finestra.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
finestra.setCurrentDirectory( new File ("c:\\"));
int risposta=finestra.showSaveDialog(this);
if (risposta == JFileChooser.APPROVE_OPTION)
{
try
{
File cart = finestra.getCurrentDirectory();
urlFrames=cart.getAbsolutePath();
int frameId=0;
for ( int i=0; i<=totalFrames; i=i+camp)
{
j++;
frameId++;
// inizialmente mi posiziono sul frame 0 (istante 0)
if (i==0)
fpc.skip(0);
// poi mi posiziono sui frame successivi, secondo il campionamento
else
fpc.skip(camp);
// grabba il frame relativo
if (currentFrame !=FramePositioningControl.FRAME_UNKNOWN)
{
currentFrame =fpc.mapTimeToFrame(p.getMediaTime());
currentTime = fpc.mapFrameToTime(i);
}
Buffer buff = new Buffer();
buff = fgc.grabFrame();
// converte buffer - image
BufferToImage bti = new BufferToImage((VideoFormat)buff.getFormat());
img = bti.createImage(buff);
if(j%65==0) k++; //k è il nome della cartella
new File(urlFrames+"/"+k).mkdirs();
String pathFrame = (urlFrames+"/"+k+"/"+j+".jpg");
File fileFrame = new File(pathFrame);
}
catch (Exception EX)
{
System.out.println("errore");
}
L'errore mi sa che è nel pathFrame.sarà una cavolata...è tutto il giorno che ci lavoro sopra e sn così rinco che nn riesco a risolverlo