Quicktime movies in java

I am trying to write a program that uses quicktime videos, but I am unsure of where to start, I didn't see anything in the API docs on this viewing quicktime videos, any help?
Thanks in advance

Go to http://developer.apple.com/quicktime/qtjava/index.html
All the best :)

Similar Messages

  • Problem using BufferToImage with Quicktime mov�s.

    I have modified the FrameAccess.java in an attempt to grab frames from a quicktime movie and output them as jpeg sequence. While I can use FrameAcess to grab the frames of an avi, I cannot get it to output frames from the quicktime movie.
    The qicktime movie I am using plays fine within jmf (in fact it was generated by jmf) and it plays fine within the standard quicktime player.
    However, when I use the bufferToImage method on a quicktime movie, it always outputs a null image (I have tried various methods).
    I have provided my complete code (which has a hardcoded link to a quicktime file). Any ideas? Has anyone been able to do this? Perhaps I have a format error? Should jmf really be this confusing?
    Thanks,
    -Adam
    import java.awt.*;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.Format;
    import javax.media.format.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.media.util.BufferToImage;
    import java.awt.image.BufferedImage;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import java.util.*;
    import javax.imageio.event.*;
    * Sample program to access individual video frames by using a "pass-thru"
    * codec. The codec is inserted into the data flow path. As data pass through
    * this codec, a callback is invoked for each frame of video data.
    public class FrameAccess extends Frame implements ControllerListener {
         Processor p;
         Object waitSync = new Object();
         boolean stateTransitionOK = true;
         public boolean open(MediaLocator ml) {
              try {
                   p = Manager.createProcessor(ml);
              } catch (Exception e) {
                   System.err.println("Failed to create a processor from the given url: " + e);
                   return false;
              p.addControllerListener(this);
              p.configure();
              if (!waitForState(p.Configured)) {
                   System.err.println("Failed to configure the processor.");
                   return false;
              p.setContentDescriptor(null);
              TrackControl tc[] = p.getTrackControls();
              if (tc == null) {
                   System.err.println("Failed to obtain track controls from the processor.");
                   return false;
              TrackControl videoTrack = null;
              for (int i = 0; i < tc.length; i++) {
                   if (tc.getFormat() instanceof VideoFormat) {
                        videoTrack = tc[i];
                        break;
              if (videoTrack == null) {
                   System.err.println("The input media does not contain a video track.");
                   return false;
              System.err.println("Video format: " + videoTrack.getFormat());
              // Instantiate and set the frame access codec to the data flow path.
              try {
                   Codec codec[] = { new PreAccessCodec(), new PostAccessCodec() };
                   videoTrack.setCodecChain(codec);
              } catch (UnsupportedPlugInException e) {
                   System.err.println("The process does not support effects.");
              // Realize the processor.
              p.prefetch();
              if (!waitForState(p.Prefetched)) {
                   System.err.println("Failed to realize the processor.");
                   return false;
              setLayout(new BorderLayout());
              Component cc;
              Component vc;
              if ((vc = p.getVisualComponent()) != null) {
                   add("Center", vc);
              if ((cc = p.getControlPanelComponent()) != null) {
                   add("South", cc);
              // Start the processor.
              p.start();
              setVisible(true);
              return true;
         public void addNotify() {
              super.addNotify();
              pack();
         * Block until the processor has transitioned to the given state. Return
         * false if the transition failed.
         boolean waitForState(int state) {
              synchronized (waitSync) {
                   try {
                        while (p.getState() != state && stateTransitionOK)
                             waitSync.wait();
                   } catch (Exception e) { }
              return stateTransitionOK;
         * Controller Listener.
         public void controllerUpdate(ControllerEvent evt) {
              if (evt instanceof ConfigureCompleteEvent
                        || evt instanceof RealizeCompleteEvent
                        || evt instanceof PrefetchCompleteEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = true;
                        waitSync.notifyAll();
              } else if (evt instanceof ResourceUnavailableEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = false;
                        waitSync.notifyAll();
              } else if (evt instanceof EndOfMediaEvent) {
                   p.close();
                   System.exit(0);
         public static void main(String[] args) {
              String s = "c:\\videoTest\\testJava.mov";
              File f= new File(s);
              MediaLocator ml=null;
              try {
              if ((ml = new MediaLocator(f.toURL())) == null) {
                   System.err.println("Cannot build media locator from: " + s);
                   System.exit(0);
              }} catch(Exception e) { }
              FrameAccess fa = new FrameAccess();
              if (!fa.open(ml))
                   System.exit(0);
         static void prUsage() {
              System.err.println("Usage: java FrameAccess <url>");
         public class PreAccessCodec implements Codec {
              void accessFrame(Buffer frame) {
                   long t = (long) (frame.getTimeStamp() / 10000000f);
                   System.err.println("Pre: frame #: " + frame.getSequenceNumber()+ ", time: " + ((float) t) / 100f + ", len: "+ frame.getLength());
              protected Format supportedIns[] = new Format[] { new VideoFormat(null) };
              protected Format supportedOuts[] = new Format[] { new VideoFormat(null) };
              Format input = null, output = null;
              public String getName() { return "Pre-Access Codec"; }
              public void open() { }
              public void close() {}
              public void reset() {}
              public Format[] getSupportedInputFormats() { return supportedIns; }
              public Format[] getSupportedOutputFormats(Format in) {
                   if (in == null)
                        return supportedOuts;
                   else {
                        // If an input format is given, we use that input format
                        // as the output since we are not modifying the bit stream
                        // at all.
                        Format outs[] = new Format[1];
                        outs[0] = in;
                        return outs;
              public Format setInputFormat(Format format) {
                   input = format;
                   return input;
              public Format setOutputFormat(Format format) {
                   output = format;
                   return output;
              public int process(Buffer in, Buffer out) {
                   // This is the "Callback" to access individual frames.
                   accessFrame(in);
                   // Swap the data between the input & output.
                   Object data = in.getData();
                   in.setData(out.getData());
                   out.setData(data);
                   // Copy the input attributes to the output
                   out.setFormat(in.getFormat());
                   out.setLength(in.getLength());
                   out.setOffset(in.getOffset());
                   return BUFFER_PROCESSED_OK;
              public Object[] getControls() {
                   return new Object[0];
              public Object getControl(String type) {
                   return null;
         public class PostAccessCodec extends PreAccessCodec {
              public PostAccessCodec() {
                   // this is my guess for the video format of a quicktime? Any ideas?
                   VideoFormat myFormat= new VideoFormat(VideoFormat.JPEG, new Dimension(800,
                             600), Format.NOT_SPECIFIED, Format.byteArray,
                             (float) 30);
                   supportedIns = new Format[] { myFormat };
                   // this will load in an avi fine... but I commented it out
                   //supportedIns = new Format[] { new RGBFormat() }; /
              void accessFrame(Buffer frame) {               
              if (true) {
                   System.out.println(frame.getFormat());
                   BufferToImage stopBuffer = new BufferToImage((VideoFormat) frame.getFormat());
                   Image stopImage = stopBuffer.createImage(frame);
                   if (stopImage==null) System.out.println("null image");
                   try {
                        BufferedImage outImage = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
                        Graphics og = outImage.getGraphics();
                        og.drawImage(stopImage, 0, 0, 800, 600, null);
                        //prepareImage(outImage,rheight,rheight, null);
                        Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
                        ImageWriter writer = (ImageWriter) writers.next();
                        //Once an ImageWriter has been obtained, its destination must be set to an ImageOutputStream:
                        File f = new File("newimage" + frame.getSequenceNumber() + ".jpg");
                        ImageOutputStream ios = ImageIO.createImageOutputStream(f);
                        writer.setOutput(ios);
                        //Add writer listener to prevent the program from becoming out of memory
                   writer.addIIOWriteProgressListener(
                             new IIOWriteProgressListener(){
                             public void imageStarted(ImageWriter source, int imageIndex) {}
                             public void imageProgress(ImageWriter source, float percentageDone) {}
                             public void imageComplete(ImageWriter source){
                             source.dispose();
                             public void thumbnailStarted(ImageWriter source, int imageIndex, int thumbnailIndex) {}
                             public void thumbnailProgress(ImageWriter source, float percentageDone) {}
                             public void thumbnailComplete(ImageWriter source) {}
                             public void writeAborted(ImageWriter source) {}
                        //Finally, the image may be written to the output stream:
                        //BufferedImage bi;
                        //writer.write(imagebi);
                        writer.write(outImage);
                        ios.close();
                   } catch (IOException e) {     
                        System.out.println("Error :" + e);
              //alreadyPrnt = true;
              long t = (long) (frame.getTimeStamp() / 10000000f);
              System.err.println("Post: frame #: " + frame.getSequenceNumber() + ", time: " + ((float) t) / 100f + ", len: " + frame.getLength());     
              public String getName() {
                   return "Post-Access Codec";

    Andyble,
    Thanks for the suggestion. When I use your line, my Image is no longer null (and the resulting BufferedImage is not null either), but it outputs a "black" in the jpeg file. Any other ideas? What did you mean by a -1 F for the frame rate? Did you mean changing the format to a negative 1 frame rate? I tried that, but it did not seem to have any change. Can you let me know if I misunderstood that. Thanks.
    -Adam

  • Export embedded quicktime movies to html slideshow?

    I'm trying to make an html slideshow of a keynote presentation that has embedded quicktime movies. The movies just get saved as single png images. Is there a workaround or something obvious I am overlooking?
    Since iPhoto lets you do this, I would assume it isn't impossible, but perhaps it just isn't implemented within keynote (which seems kind of backward).

    Thanks. I was afraid that was the case, but a former apple VP suggested I ask since there are many apparently undocumented features (and iPhoto/iWeb can do this, so the api exists).
    The relevent html code is actually a java script that loads an array of exported png files. Each element of the array is defined like this:
    images[2] = "mrnahh.html_files/mrnahh.003.png";
    so I tried just telling it to load a mov file instead, but it wasn't so easily fooled. It might be easier for me to make a slideshow of the png files and mov files within iWeb (which really makes messy html and javascripts that are next to impossible to hack.)
    Anyway, many thanks. I'll leave this open for now in case someone else knows a simple secret.
    The HTML export feature is great, and produces nice clean simple interfaces and web code. I hate to abandon it.

  • Help unlocking a locked or unsaveable quicktime movie

    Hi, I'm working a website for a client, and they want me to download a quicktime movie from their parent company. The quicktime seems to be locked or unsaveable, I can't right click on the file or do a save as or anything like I can normally do with my Quicktime Pro.
    Is there a way around this? Is there any third party software that will capture the movie?
    Thanks,
    Brown.Recluse

    Keep in mind that the web page can have allllllllll the coding in the world but it is up to the web browser whether or not to actually run any of the code...
    http://www.mozilla.com/firefox/
    Firefox menu > Preferences > Content > Enable Java / Enable Javascript > Advanced > Allow Scripts To --- uncheck "Disable or replace context menus."
    Then go right-click wherever you want.
    "Disable or replace context menus: Enables or disables web pages from changing or disabling the Firefox context menu."
    Quote from "Protecting Your Security and Privacy with Firefox"
    http://www.informit.com/articles/article.asp?p=382613&seqNum=6&rl=1
    And also...
    http://insanityflows.net/archive/index.php?title=QuickTime#Unlockmov_files_that_areuneditable

  • Safari crashed opening quicktime movies after 10.4.4

    Hi,
    Tried to open quicktime mov (from link on website) from safari and safari crashed. Tried a few times (after re-logging, and restarting) with the same result. Quicktime standalone v.7.0.4 have no problem starting. Finally resorted to Firefox, without any problems and no crashes running quicktime mov!
    Also found-out that on some website, you need to disable plug-ins and Java (from the preferences) before able to click links. Try "www.aqua-macro.com". Website problems? or plug-ins/java?
    Thanks.

    I originally updated through sys pref and just let it go. One day later things stopped working. Repairing permissions etc did nothing. Applied the combo update, verified the disk before hand, repaired permissions after the update and reboot, now things are back to normal as far as I can tell, better even in some areas. Hope this can help others with similar problems.

  • How many times can you "Export - Quicktime movie" the same ProRes 422 file until it starts to lose quality?

    Lets say you are done with your project & you want an uncompressed copy of it as your master. If you keep importing it back into Final Cut Pro, & keep exporting (Quicktime movie), will it ever start to lose quality?

    I've never seen a number given, but would think it is very high.
    Apple describes ProRes here:
    About Apple ProRes
    And in that document says:
       "while remaining visually lossless through many generations of decoding and reencoding."
    I don't think I've ever seen degradation caused by recompression or multiple compassion, but as a workflow if you output a master file, then re-import it to add graphics and export that, you would only be 1 generation down from the master file. If you wanted to make multiple versions, you can always go back to, and re-import,  the master file and make the changes, then export, so all you exports stay only 1 generation down from the master file.
    MtD

  • Unable to Sync Quicktime Movie Clips with IPOD

    I am a new ipod user having difficulty syncing Quicktime movie clips to IPOD.
    Clips are saved as .mov files and Itunes will play.
    However I cannot get them to sync woth IPOD.
    Any ideas - Do I need to convert to annother format?

    First you need to import your movies into iTunes. Do this by opening iTunes <File> <Import> <Movies> then choose the movie you want to put on your iPod. Make sure the movie has .mov at the end otherwise it won't be set up the way it's supposed to be.
    Once the movie is imported into iTunes right click on it so a pull down menu appears. Click on <Convert Selection for iPod/iPhone>. It should begin converting it on its own and when it's done you'll hear the typical sound that happens after importing a cd, telling you the operation is complete.
    After it's converted, you will have 2 identical movies in your menu. If you <Get Info> on each, you should be able to see which is newest version; that is the movie you are going to want to sync.
    Then plug your iPod in to iTunes, go to the movie tab in iPod summary and check off the converted movies you want to sync to your iPod. Press <Sync> and that should add your movies to your iPod.
    Hope this helps.

  • Quicktime movie rendering for time lapse does not work in CS4

    Hey guys,
    I m trying to render a time lapse video on PS CS4 and the process works well up until the export window. When i go there the first option under file options, quick time export, is unavailable( grayed out). The only available option is Image sequence. What do i have to do to enable the quicktime movie creation or any other movie format for that matter? Thank you.

    Welcome to the forum.
    For PS CS4, I assume that you have PS-Extended. Is that correct?
    What OS/platform?
    Do you have Apple's QT installed on that computer? If so, what version?
    Good luck,
    Hunt

  • Quicktime movies don't show in browser

    Was having trouble with quicktime movies playing in Safari and Firefox. Each time I got the broken Q, I would restart the computer and it would work for a while. Upgraded to OS X(10.5) in hopes that might help. It didn't. No matter what I do no Quicktime in browser or a places like myspace. Any ideas?

    Andrea Turriziani has a solution for the problem - here's the link
    http://discussions.apple.com/thread.jspa?messageID=5682162
    Good luck,
    Tom

  • Output quicktime movie choppy and less sharp than original

    Goodmorning!
    I am planning to make a stand alone movie of my footage that I can keep and watch on my iMac. My sequence was made on FCP 7 on 1920 x 1080 with Prores 422 codec.
    I did a few tests with exporting to quicktime movie (standard settings), because I have read several times that converting this way results in more or less the same quality. When I compare the videoquality of the Quicktime movie with playing the footage on the timeline fullscreen (+view-external video-all frames+), I am very disappointed. Not only is the sharpness of the quicktime movie less than the original, the movie plays very choppy (not fluently at all) .
    My question is: is that result to be expected? May I compare a quicktime movie with the original as described before?
    Or maybe I should export the sequence in a more sophisticated way?
    The quicktime outcome was about 30 seconds and resulted in a file of about 500 MB. My wish is that the size of the file will not be bigger.
    I hope that you can help me. Thanks in advance.

    Tom,
    Three times "correct" to your three questions.
    Opened the exported file in the QuickTime player, Movie Inspector said:
    Structure: Apple ProRess 422 , 1920 x1080 (1888 x 1062) millions, 16-bit integer (little indian) Stereo 48000 khz
    Bps: 25
    Size: 561,7 MB
    Speed: 118,53 Mbit/s
    Current size: 1882 x 1058 pixels
    If I run the sequence through JED deinterlacer, the movie gets a better flow. Of course the sharpness deminish a bit too.
    I hope that you can help me.
    Would export in H.264 be a better option?
    Maybe the 25 Bps is too high? My Panasonic SD60 produces only 17 mb Mbps.

  • Can't use HDV quicktime .mov files (captured in Final Cut Pro) on a mac at work) on my PC at home

    Hiya everyone!
    I've taken some work home from the macs at work, but can't open it on my PC.
    Footage was captured in FCP on a mac at work, HDV quicktime .mov, but won't open in the newest quicktime, windows media player and more importantly in Adobe After Effects CS3 or Premiere Pro CS3 on my PC at home.
    When I try opening the files in quicktime, the screen is white, but the audio plays. They don't open in windows media player at all. When I try to import them into Premiere, I get a message reading, "Error Message, Codec missing or unavailable". But they import into After Effects, except they only play as white...
    I've tried converting them into almost everything, and they often play (as .avi for example in the newest QT, WMP, Adobe Premiere and AE), but they increase A LOT in size and decrease A LOT in quality.
    The HDV files that won't open read as:
    Source: *.mov
    Format: HDV 1080i50, 1920 x 1080, Millions 16-bit Integer (Little Endian), 48.000 kHz
    Movie FPS: 25.00
    Playing FPS: (Available when playing)
    Data Size: 69.53 MB
    Data Rate: 28.10 mbits/sec
    Current time: 00:00:01.64
    Duration: 00:00:20.76
    Normal size: 1920 x 1080
    Current size: 1920 x 1080
    Anything smaller than 1920 x 1080 plays fine.
    I've been all through google, and the adobe and apple sites, and the best I could find is here:
    http://discussions.apple.com/message.jspa?messageID=7753066#7753066
    and
    http://discussions.apple.com/thread.jspa?messageID=8159317&#8159317
    My problem is almost identical to these 2...
    No one in the whole world seems to have an answer...
    Does anyone here know how I can use the HDV files from the work macs on my PC at home?
    -Kaiwin

    As a rule of thumb, any CoDec associated with the Apple Pro applications is generally not available on Windows. This also includes their flavor of HDV. The only exception at this point is ProRes, for which they added a player component recently. So therefore this would have to be what you use for capture/ export from FCP. Apart from that you can of course always buy a capture card from Blackmagic or AJA with the benefit of the CoDecs being available cross-platform... Or you use a commercial software-only CoDec like Cineform.
    Mylenium

  • Can't Export from FCE to QuickTime Movie w/o recompression

    I have problems with choosing the correct settings for export of a FCE video clip to QuickTime Movie. I want the best possible quality (without recompression).
    In the manual it says:
    "Exporting a Self-Contained Movie Without Recompressing the Media
    If you choose to export a self-contained movie, you have the option to not recompress the media in your clip or sequence. If you deselect the Recompress All Frames option and choose Current Settings from the Setting pop-up menu, Final Cut Express simply copies frames from existing media files into the new file with no recompression."
    I can't find that option in FCE 4.01 - is it a mistake in the manual? My source media was captured from miniDV tape and the captured media file has the following formate:
    Codec: DV/DVCPRO - NTSC, Linear PCM, Timecode
    Color profile: SD (6-1-6)
    Total bit rate: 29,794
    My exported file has this format:
    Dimensions: 720 x 480
    Codec: Linear PCM, H.264
    Color Profile: SD (6-1-6)
    Audio Channels: 2
    Total bit rate: 2,151
    I have seen this question in the FCE archive and people simply say there is no recompression in FCE Export to QT Movie, but clearly there is since I see the H.264 codec listed in my output file and the bit-rate is a about 1/14th the rate of the original source material. The output file size is also much smaller. What gives. How can I get an unrecompressed file out of FCE so I can send it to a coworker for futher editing with his FCE.

    dsut56 wrote:
    Does anyone else have anything to add to this thread. I'm, sure I'm using Export to QuickTime Movie and not using QuickTime Conversion and from the file specifications I've given above, it is clear that a 14:1 compression took place.
    Doug
    Double check:
    There are only three options in the QuickTime Movie export window.
    1. Include: The Audio and Video, Audio Only or Video Only.
    2. Markers: Select whateve you want or don't want.
    3. The Make Movie Self-Contained selection check box.
    Is this what  you see?
    The export will mirror the Sequence or selected part of the Sequence.
    Al

  • Hello there - I am sharing an iPhoto library across two accounts on the same computer - it works fine EXCEPT for Quicktime movies - they play on one account and claim I don't have the rights on the other - all permissions are on and ok?

    Hello there - I am sharing an iPhoto library across two accounts on the same computer - it works fine EXCEPT for Quicktime movies - they play on one account and claim I don't have the rights on the other - all permissions are on and ok?

    It should be in the Users/ Shared folder.
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Note the option to check and repair Library Permissions
    Regards
    TD

  • How do you move a quicktime movie from one iphoto library to another?

    How do you move a quicktime movie from one iphoto library to another?

    1 - export it from Library A via the File ➙ Export ➙ File Export menu with Kind = Original.
    2 - import it into Library B as you normally would.
    OT

  • How do I make quicktime movies Fullscreen in iWeb?

    How do I make quicktime movies Fullscreen in iWeb? Can anyone help me please?

    You have to create a QTL file that opens the QT movie in the player. Based on the settings it opens in Full Screen.
    You may want to read this:
    [QuitTime Tutorials and more|http://www.apple.com/quicktime>
    [Launching QuickTime Player from a Text Link |http://developer.apple.com/documentation/QuickTime/QT4WebPage/samplechap/speci al-11.html]
    An alternative is to publish your movies to Vimeo and embed the movie in your page. These movies can play full screen.
    Or use DivX of Flash Video.
    Samples here: http://web.mac.com/wyodor/iFrame/

Maybe you are looking for

  • Error while creating resource in SAP TM GUI and NWBC

    Hi Experts, I am trying to create a resource in SAP TM. But getting the following error, I have activated all the relevant business functions (tcode SFW5) and also relevant services (tcode SICF) but still unable to get away with the issue. The NWBC e

  • Matchcode for subscreen select options

    Hi, I am displaying a selection screen subscreen as a popup in my report using module pool and it has two fields say, 1. ABC 2. XYZ I need to implement custom search help for these two fields. The problem is where to implement this?? My report struct

  • Cant play videos or view pictures in photo library

    i clicked on photo library and it said restoring and updating photo library i clicked on it again when it had finsished and it started updating and restoring again i then clicked on it again when it had finished for the second time and it duplicated

  • Derivation rule for value fied

    can any one tel me how we define derivation rules for value fields. is it posible to put derivation and how it will effect. Thanks&Regards Amar

  • Error Hospital to handle Functional Errors

    Hi, In my implementation I'm consuming external Web Services from BPEL. Some of those webservices may return errors in a controlled fashion, returning a numeric field that indicates failure due to whatever reasons. My question is: Can a BPEL process