0

how to create mpeg video out of list of images using java codes ! I've tried to use DataOutputStream but it didn't work and here is a bit of my code :

        DataOutputStream dos = new DataOutputStream(new FileOutputStream("s.mpeg"));
        DataInputStream dis = new DataInputStream(new FileInputStream("image.jpg"));
        while (dis.available()>0) 
        {              
            byte data[] = new byte[ dis.available()];
            dis.read(data);
            dos.write(data);
        }
        dis.close();
        dos.close();

any help please !

Sam
  • 149
  • 11
  • 2
    A video file is wayyy more complicated that a bunch of images grafted together. See http://stackoverflow.com/questions/11985706/how-to-create-mpeg-video-from-images-in-java. – Jazzwave06 Dec 28 '14 at 15:54
  • What you have done so far is just copying the image data into a new file with the extension `mpeg`. I am afraid video processing is not as simple as you think (concatenated image data). – A4L Dec 28 '14 at 15:56
  • is there any api you know that help me in creating a video from images !! – Sam Dec 28 '14 at 16:07
  • We gave you two links. You have to do your part of the job. – Jazzwave06 Dec 28 '14 at 16:13
  • Okay man thanks a lot I'll try and I'll tell you the result – Sam Dec 28 '14 at 16:16
  • http://www.ffmpeg.org/faq.html#How-do-I-encode-single-pictures-into-movies_003f that ffmpeg command on cli will make a movie from a series of jpg's that have fileName matching the CLI pattern. – Robert Rowntree Dec 28 '14 at 16:53

0 Answers0