Thursday, May 27, 2010

Phase 1 Part 1 - Planned User Intarface

This is how the application will look after the completion of the first three weeks of phase one.
You can select any image from the timeline then it's details will be displayed as shown in the diagram. The details will include start time and end time. If you increase the start time the end time of the previous image will automatically be reduced.

Sunday, May 16, 2010

FMJ or JMF ??

Last couple of weeks I've been experimenting with FMJ (Freedom for Media in Java) and JMF (Java Media Framework). FMJ sounds promising, but according to my research it does not support everything I need in my application.

First I tried to create a video with a set of images. It works with JMF. But unfortunately there are no codecs for video formats available in FMJ.

Given below are the Media formats supported by FMJ. Even in FMJ forums it is asked to use JMF in places where certain codecs are missing in FMJ.

Pure Java processing and playback
ContainerFormatDecode (D), Encode (E)
RTPJPEG/RTPD,E
ULAW/RTPD,E
ALAW/RTPD,E
SPEEX/RTPD,E
ILBC/RTPD,E
WAVLINEAR (PCM)D,E
AULINEAR (PCM)D,E
ULAWD,?
AIFFLINEAR (PCM)D,E
multpart/x-mixed-replaceJPEGD,E
GIFD,E*
PNGD,E
OggVORBISD
THEORAD
MP3MP3D

* - encoding only with Java 6+

Saturday, May 1, 2010

Testing QuickTime for Java

I am experimenting with various media supporting libraries for Java these days. Java Media Framework (JMF) in the previous post is one of them.
I also found this interesting library provided by QuickTime. But it works only with QuickTime player. Given below are the steps I followed and a sample code I tested.

The first step is to install QuickTime. In QuickTime you can find a the java library QuickTime for Java in the part QuickTime/QTSystem/QTJava.zip. This QTJava.zip contains all the libraries needed.
I imported this QTJava.zip to Eclipse and tried the following sample code provided in QuickTime for Java Wiki page (http://en.wikipedia.org/wiki/QuickTime_for_Java).

import java.io.File;
import java.awt.*;

import quicktime.*;
import quicktime.std.movies.Movie;
import quicktime.app.view.QTFactory;
import quicktime.io.*;
import sun.audio.AudioPlayer;

public class TrivialQTJPlayer extends Frame {
public static void main (String[] args) {
try {
QTSession.open();
Frame f = new TrivialQTJPlayer();
f.pack();
f.setVisible (true);
} catch (Exception e) {
e.printStackTrace();
}
}
public TrivialQTJPlayer()
throws QTException {
FileDialog fd = new FileDialog
(this, "TrivialJMFPlayer", FileDialog.LOAD);
fd.setVisible(true);
File f = new File (fd.getDirectory(), fd.getFile());
OpenMovieFile omf = OpenMovieFile.asRead (new QTFile (f));
Movie m = Movie.fromFile (omf);
Component c = QTFactory.makeQTComponent(m).asComponent();
add (c);
m.start();
}


}

This code creates a QTJ player and you have to give a *.mov file as input for this sample. There are many other file types supported by QT for Java.
The only constraint with this is that you must have a QuickTime player to run any application you've written by using QuickTime for java.