Ho fatto questo attraverso QTJ con la classe MovieMaker da processing librerie (GPL). L'elaborazione è pura java, sebbene possa nasconderla per i principianti.
piccolo tutorial: Scarica Processing, aprirlo, andare Sketch -> Mostra cartella Sketch, crea una cartella chiamata "dati", e mettere tutte le immagini all'interno di quella cartella, denominata "filename01.gif" attraverso " filename09.gif". Incollare il seguente codice nell'editor, e ha colpito il gioco:
/**
* Makes a QuickTime movie out of an array of images.
*/
import processing.video.*;
MovieMaker mm;
PImage[] imageFrames;
int index;
void setup() {
size(320, 240);
int numFrames = 9;
imageFrames = new PImage[numFrames];
for(int i = 0; i < imageFrames.length; i++)
{
imageFrames[i] = loadImage("filename" + nf(i+1,2) + ".gif");
}
// Save uncompressed, at 15 frames per second
mm = new MovieMaker(this, width, height, "drawing.mov");
// Or, set specific compression and frame rate options
//mm = new MovieMaker(this, width, height, "drawing.mov", 30,
// MovieMaker.ANIMATION, MovieMaker.HIGH);
}
void draw() {
if(index < imageFrames.length)
{
// show the image
image(imageFrames[index], 0, 0);
// Add window's pixels to movie
mm.addFrame();
index++;
}
else
{
mm.finish();
// Quit running the sketch once the file is written
exit();
}
}
questo creerà un file "drawing.mov" dalle immagini nella cartella schizzo. Se vai al file -> esporta l'applicazione, quindi apri la cartella dello schizzo e vai alla cartella application.macosx/source o application.windows/source, dovrebbe esserci un file .java con il codice effettivo, che dovrebbe apparire in questo modo:
import processing.core.*;
import processing.xml.*;
import processing.video.*;
import java.applet.*;
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.text.*;
import java.util.*;
import java.util.zip.*;
import java.util.regex.*;
public class movie2 extends PApplet {
/**
* Makes a QuickTime movie out of an array of images.
*/
MovieMaker mm;
PImage[] imageFrames;
int index;
public void setup() {
size(320, 240);
int numFrames = 9;
imageFrames = new PImage[numFrames];
for(int i = 0; i < imageFrames.length; i++)
{
imageFrames[i] = loadImage("filename" + nf(i+1,2) + ".gif");
}
// Save uncompressed, at 15 frames per second
mm = new MovieMaker(this, width, height, "drawing.mov");
// Or, set specific compression and frame rate options
//mm = new MovieMaker(this, width, height, "drawing.mov", 30,
// MovieMaker.ANIMATION, MovieMaker.HIGH);
}
public void draw() {
if(index < imageFrames.length)
{
// show the image
image(imageFrames[index], 0, 0);
// Add window's pixels to movie
mm.addFrame();
index++;
}
else
{
mm.finish();
// Quit running the sketch once the file is written
//exit();
println("done");
}
}
static public void main(String args[]) {
PApplet.main(new String[] { "--bgcolor=#e0dfe3", "movie2" });
}
}
usare Java puro, è necessario utilizzare core.jar e video.jar dalla cartella applicazione di elaborazione sul classpath, e quindi compilare il codice Java. Ecco uno function reference e uno javadoc per la libreria di elaborazione. Here are the javadocs for the MovieMaker class. Se lo desideri, puoi vedere source nella classe MovieMaker.
HTH