DWR200
asked on
images to movie
Hi guys.
im able to save images from the streaming media live from an ip camera using FileOutputStream. howeer now i need to like merge all those images n make it into a movie. (eg .mov). anyone has any java codes to do this??
public void readJPG(){ //read the embedded jpeg image
try{
JPEGImageDecoder decoder = JPEGCodec.createJPEGDecode r(dis);
image = decoder.decodeAsBufferedIm age();
String s="a"+counter+".jpg";
counter++;
String filename="c:\\find\\"+s;
BufferedImage smaller = toBufferedImage(getScaledI nstanceAWT (image, 1.0/3.0));//scalling image size
try {
OutputStream out = new FileOutputStream(filename) ;
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncode r(out);
encoder.encode(smaller);
out.close();
} catch (Exception e) {
System.out.println(e);
}
}catch(Exception e){e.printStackTrace();dis connect(); }
}
public void readLine(int n, DataInputStream dis){ //used to strip out the header lines
for (int i=0; i<n;i++){
readLine(dis);
}
}
im able to save images from the streaming media live from an ip camera using FileOutputStream. howeer now i need to like merge all those images n make it into a movie. (eg .mov). anyone has any java codes to do this??
public void readJPG(){ //read the embedded jpeg image
try{
JPEGImageDecoder decoder = JPEGCodec.createJPEGDecode
image = decoder.decodeAsBufferedIm
String s="a"+counter+".jpg";
counter++;
String filename="c:\\find\\"+s;
BufferedImage smaller = toBufferedImage(getScaledI
try {
OutputStream out = new FileOutputStream(filename)
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncode
encoder.encode(smaller);
out.close();
} catch (Exception e) {
System.out.println(e);
}
}catch(Exception e){e.printStackTrace();dis
}
public void readLine(int n, DataInputStream dis){ //used to strip out the header lines
for (int i=0; i<n;i++){
readLine(dis);
}
}
http://java.sun.com/products/java-media/jmf/2.1.1/solutions/JpegImagesToMovie.java
And maybe good to know:
http://www.codefund.com/514/jpeg-to-movmpeg-or-avi-5141426.shtm
http://www.codefund.com/514/jpeg-to-movmpeg-or-avi-5141426.shtm
ASKER
hey thanks. i look trhough the codes. but where is the part to actually retrieve the images? i stored the saved images in a specific folder. any codes to modify to retrieve images from a specific source?
>> but where is the part to actually retrieve the images?
I don't understand. Didn't you say:
>> im able to save images from the streaming media
I don't understand. Didn't you say:
>> im able to save images from the streaming media
ASKER
yes im able to save the images. but how do i implement the the source you give to me? cos the codes you give me at some point need to read the images right to make it into a movie?
>> at some point need to read the images right to make it into a movie?
Since the usage of the program is:
java JpegImagesToMovie -w <width> -h <height> -f <frame rate> -o <output URL> <input JPEG file 1> <input JPEG file 2> ...
I thought you don't need to bother about that...
Since the usage of the program is:
java JpegImagesToMovie -w <width> -h <height> -f <frame rate> -o <output URL> <input JPEG file 1> <input JPEG file 2> ...
I thought you don't need to bother about that...
ASKER
ouh. i didnt see that. ill try to figure that out.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yes. i managed to do it. thank you. but however.i have to change some codes man. i have like a few hundreds images man. i cant posible type every single file directory. haiz
>> yes. i managed to do it.
Good to hear.
>> but however.i have to change some codes man.
>> i have like a few hundreds images
Then use one txt file that contains the files to process:
ToProcess.txt
------------------
c:/dir1/dir2/whatever/file 1.jpg
c:/dir1/whatever/file2.jpg
c:/dir1/file97.jpg
...
Reading Text from a File:
try {
BufferedReader in = new BufferedReader(new FileReader("c:/dir1/dir2/T oProcess.t xt"));
String str;
while ((str = in.readLine()) != null) {
process(str);
}
in.close();
} catch (IOException e) {
}
in which the method process(str)
just does the filling of the vector "inputFiles" with the read jpg file name:
private process(String str) {
inputFiles.add(str);
}
Good to hear.
>> but however.i have to change some codes man.
>> i have like a few hundreds images
Then use one txt file that contains the files to process:
ToProcess.txt
------------------
c:/dir1/dir2/whatever/file
c:/dir1/whatever/file2.jpg
c:/dir1/file97.jpg
...
Reading Text from a File:
try {
BufferedReader in = new BufferedReader(new FileReader("c:/dir1/dir2/T
String str;
while ((str = in.readLine()) != null) {
process(str);
}
in.close();
} catch (IOException e) {
}
in which the method process(str)
just does the filling of the vector "inputFiles" with the read jpg file name:
private process(String str) {
inputFiles.add(str);
}
ASKER
kkk. dude thanks i will try the new code out. but thanks again.
ASKER
zzynx, can i ask u something. is it posible to record video stream using java coding? because that is actually the specs of my project. and i cant find any solution of recording stream of video. right now all i can find is this which is to save the images and make it into movie file.
hope that you any suggestions or solutions would be better.
hope that you any suggestions or solutions would be better.
>> zzynx, can i ask u something.
Sure
>> is it posible to record video stream using java coding?
According to this (http://www.mutong.com/fischer/java/usbcam/) it is possible
Like I always say: "In programming (no matter what language) everything is possible" ;°)
btw, thanx 4 axxepting
Sure
>> is it posible to record video stream using java coding?
According to this (http://www.mutong.com/fischer/java/usbcam/) it is possible
Like I always say: "In programming (no matter what language) everything is possible" ;°)
btw, thanx 4 axxepting
ASKER
ok. been to that website before. but the case now is that im dealing with IP camera. Axis IP camera 211A to be exact.
It must be possible.
But I'm not the right person to help you with this specific problem.
Try posting a new Q concerning this item.
I'm sure other experts will be able to help you.
But I'm not the right person to help you with this specific problem.
Try posting a new Q concerning this item.
I'm sure other experts will be able to help you.