Jeremy Woods wrote an article with some brilliant Java classes which can write QuickTime movies with JPEG encoded video frames.

I wanted to write a lossless QuickTime movie encoder for a long time, so I couldn’t resist taking Jeremy’s code, and see whether it was possible to add support for PNG encoded video frames.

After tinkering with the code a bit, I decided rewriting it entirely by reusing designs I had seen in the Amiga IFF library. I also added support for large movie files (larger than 4 GB).

The QuickTimeOuputStream class is freely available as part of my CubeTwister source code.

You can download a small demo which only contains the QuickTimeOutputStream and all necessary sources here: QuickTimeDemo.jar. Running the demo will create a JPEG-encoded and a PNG-encoded QuickTime movie.

Update 2009-08-30: QuickTimeOutputStream can now also write RAW-encoded video.

7 Responses to “Writing QuickTime movies using pure Java”

  1. Melinda Squibb Says:

    Is it possible to use this code for an educational institution? What are the terms of your copyright license?

  2. werner.randelshofer Says:

    Hi Melinda,

    QuickTimeDemo is free for all uses (personal, educational, commercial, …). The terms of the Creative Commons Attribution 3.0 license apply:
    http://creativecommons.org/licenses/by/3.0/

    If you download the QuickTimeDemo.jar again, you’ll find a file named license.html inside of it, which contains these license terms as well.

    With best regards,
    Werner

  3. Melinda Squibb Says:

    Thanks, this is a great help. A problem can arise in your code in ImageDirToMovMain.test if the first file in the directory is a hidden file.

  4. werner.randelshofer Says:

    Thanks Melinda,
    I have fixed this now.
    Cheers,
    Werner

  5. AO Says:

    According to the license—

    Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).

    How would you like to be referenced in the work???

  6. werner.randelshofer Says:

    @AO,

    I would like licensors to keep the reference to me in the headers of my source files.
    That will do.

    Of course, if you do have a section in your program or accompanying documentation which mentions all software components it uses, I don’t mind being listed there.

    -Werner

  7. Werner Randelshofer’s Blog » Blog Archive » Writing AVI videos using pure Java Says:

    [...] writing QuickTime movies using pure Java turned out to be relatively easy, I gave today a try at an AVI encoder for PNG and Motion-JPEG [...]

Leave a Reply