Java: Make an animation/video from frames - java

Howdy! For a research project (in Java), I've got to find some way to save an animation of a graph into some file format. Now I've already got the program working fine drawing each frame. The problem is, short of learning the whole GIF or AVI file format, I have no idea how to assemble the frames programmatically into some sort of animation or video file. File formats don't really matter--input or output. I just need some way to put the frames together and save!
Right now I'm thinking the easiest format would be either animated GIF or AVI. Again, though, it really doesn't matter so long as it works.
Thanks a bunch!

They might not be the best options, but I just thought of these:
You might be able to use some QuickTime APIs. I know they're used fairly often for webcam input, and that they can also generate video.
You could also generate each frame and then assemble them with ffmpeg.

Try Xuggler -- it'll let you save graphics into pretty much any video format.

Related

Basic image manipulation (open, copy, crop, paste) in Java or Android

I'm creating an android apps that use basic image manipulation (open image,copy, crop, paste).
Basically, the program will have multiple image input and it will be manipulated(copy, crop, paste). Then, an output image will be saved. I had done this in python using PIL library and would like to do the same using Java.
So, how do i do this in? Can someone point me a good library that have all the features? Thanks.
Hope this makes your work on this easy. I was going through some links and found this.
Let me know if you need anything else. Thanks.Image Manipulation in Java

Getting animation information from PSD file?

I have been looking through Adobe's File Format Specification for PSD (Photoshop files) and cannot figure out where the details of animation are stored. I am looking for things like looping setting (how many time the animation should loop), duration of each frame, the number of frames in the animation, and which layers are visible on each frame.
I have a basic parser that will read through the bytes in the PSD file and can extract some basic information from the file. For the purpose of the project I am working on, I would really like to extract the animation information.
If someone knows where this data is located in the psd file, it would be really great if you could give me some tips of how to get at it. --would save me a lot of time that would be spent reverse-engineering the file format!
I am using Java for this project, but could adapt it to Objective C, C++, or C# if that is going to make any difference (e.g. in case there is already an existing parser that gets this information from a psd).
There's a PSD plugin for Paint.NET which is Open-Source. You might want to take a look at for starters:
http://frankblumenberg.de/doku/doku.php?id=paintnet:psdplugin#download

Saving part of a video with FFmpeg using C

I am creating a simple video editing application using Java, JNI, C, and FFmpeg. The UI is being designed in Java and I am talking with FFmpeg from a C file using JNI. Does anyone have any suggestions as to the best way I should go about saving part of a video file using FFmpeg? I am allowing the users to choose parts of the video to save and what I am thinking as of right now is to basically loop through all of the packets and decode each frame (if need to encode to a different format) then save the frame to a file. All the while seeking to different parts of the video based on the users start and stop sections of their crops. If this doesn't make sense I would be glad to clear it up. Any ideas are much appreciated as I am just looking to create the most efficient and correct way to go about doing this. Thanks!
Use xuggler? It will do all for you without you having to figure out the jni bindings.

Using Java to capture an area of the screen and identify text found there

This question may be beyond the scope of a simple answer here at stack overflow, but my hope is that it will lead me to be able to formulate several more specific questions to get where I need to be.
I want to write a program that searches a buffered image for text and returns it as a string. I don't want to write an entire OCR program, but would rather use an API that is freely available such as tesseract. Unfortunately I've been unable to find a Java API for tesseract.
I know that the font is arial and I know it's size. I am wondering if that will help.
I've already managed to capture the screen, but I'm not sure how to accomplish the next step of identifying the text found in the image.
the question
How can I implement a simple OCR function into my java program?
You can use tesjeract or tess4j wrapper of Tesseract API. Be sure to rescale you images to 300 DPI since screenshots' resolution (72 or 96 DPI) is in general not adequate for OCR purpose.
The OCR implementation is complicated, but using an SDK like http://asprise.com/product/ocr/index.php?lang=java is simple.

100% Java encoder for AVI animation

I am looking for a 100% Java solution for encoding software generated images into an AVI stream together with an uncompressed audio track.
At the moment I am using JMF, but its size and installation problems make it a bad solution for my purpose.
While it does not support audio, I created an MJPEG AVI Java class some years ago. You basically just tell it the resolution of your output video, along with the frame rate, then you just keep adding images to it. When you are done, you tell it to finish and it'll close out the AVI. It is based off of the Microsoft documentation on AVI, RIFF, and BITMAP file formats.
Other than not supporting audio, the only real problem is it implements the version of the AVI format limited to 2GB per file. While the class will write out a much larger file, I am uncertain that any players or video editors would be able to read it.
The way I've used this code in the past, is to generate an MJPEG AVI for processing in a video editor (adding audio, etc. in the editor). It helped me with automating some tedious slide show generation. Not sure if this code will help you, as is, but it might help if you are trying to roll your own solution. MJPEGGenerator.java is available if you are interested!
You can use JMF, see this nice example.
There is a nice blog entry here:
http://www.randelshofer.ch/blog/2008/08/writing-avi-videos-in-pure-java/
By Werner Randelshofer

Categories