creating an avi on the fly

6

6e

Im trying to build a simple avi movie file programatically. (black
background, white text, that sort of thing).
From what I've read, it seems that I will need to first build a set of
jpegs... However I haven't been able to find any references online as
to how to make a jpeg from scratch either.

if you have any information that I might be able to use please post it
here or provide a link.

Any help is greatly appreciated.
 
B

Betty

6e said:
Im trying to build a simple avi movie file programatically. (black
background, white text, that sort of thing).

jpegs... However I haven't been able to find any references online as
to how to make a jpeg from scratch either.

if you have any information that I might be able to use please post it
here or provide a link.

Any help is greatly appreciated.


public class CreateFrame {

//write the BufferedImage onto a disk file in the current directory
static void createFrame(BufferedImage I, String prefix) {
{
try {
// put files in current dir
// if you remove the third argument, the files go into the %tmp%
directory
File dir = new File(".");
File fn = File.createTempFile(prefix, ".jpg", dir);
String p = fn.getCanonicalPath();
FileOutputStream fos = new FileOutputStream(p);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fos);
encoder.encode(I);
fos.flush();
fos.close();
}
catch (FileNotFoundException e) {
System.err.println(e);
}
catch (IOException ioe) {
System.err.println(ioe);
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top