playback

Best Video Playback Codec

scalf's picture

I have been using Quartz extensively for playing back loops, adding effects, etc, and I was wondering what the fastest video coedc would be for playback in Quartz Composer?

The clips are usually played at 720, but that may be irrelevant. I have been using video programs, so converting them to any codec is not the problem, but there are so many options I was not sure which would be the most tailored to QC - H.264, ProRes, etc

Choppy Video in QC

Caelshadowhunter's picture

Hi, just a quick one.

Has anyone noticed that video playback in quartz can drop frames during video playback?

I've been having major problems. They seem to be worst when using the standard QC "movie importer" but still persists when using the same player in asynchronous mode.

I've also tried the V002 movie player, which helps again but it's still not reliable enough for what I'm trying to do.

Has anyone got any theories as to why this is happening?

Embedding Movies in Quartz Composer : Image Structures

gtoledo3's picture

It is possible to embed a movie in Quartz Composer, by following these steps:

  1. Convert the movie to an image sequence.

  2. Convert that sequence to a multipage document (like a pdf or gif).

  3. Place an Image patch on the surface of the QC Editor.

  4. Select the Image patch. Go to Settings, using the Patch Inspector. Under Image Options, select Extract All Images. Choose Import From File, choose your file, then select Open to load it into the Image patch.

    Now, the Image patch will output a structure of all frames from your movie/image sequence. By connecting a Structure Index to the output of the Image patch, and then connecting the output of the Structure Index patch to a Billboard (or other patches that render an input image), one will render the first frame in the sequence.

  5. Connect an Image Dimensions patch to the output of the Structure Index. Connect the Width and Height outputs to the Width and Height Inputs of the Billboard patch. To obtain both Width and Height Inputs for the Billboard patch, select the Patch Inspector, go to Settings, and select Custom Size.

    One should now have a Billboard rendering the first frame of the Image Sequence, referencing said Image for it's Width and Height.

  6. Now, select another Structure Index. Connect the output of the Image Patch to this Structure Index, and the output to the existing Billboard.

    By using an Interpolation or LFO patch, one could play through frames, but a good starting point for movie playback is to create a looper macro with definable FPS. There are multiple ways to achieve this. An easy way is to :

  7. Take the Patch Time, and multiply by an Operand using the Math patch, which will become the Frame Rate of the playback.

  8. Then, take a Math Expression patch and enter "a % b" into Settings.

    In this case, "a" will take the output of the Math patch. Place a Structure Count patch on the Editor, connect the input to the output of the Image patch, and the output Count to input "b" on the Math Expression patch.

  9. Take the second Structure Index that you created, and which should be connected to the Billboard, and connect the output Result of the Math Expression patch to the Index input of the Structure Index. Enter in the desired playback rate, by changing the multiplicative Operand on the Math Patch. Publish this input and call it Frame Rate.

...and you're done! One should have a qtz that is playing back an embedded movie, with ability to define the rate of playback.

For an example of this, reference the attached file.

Notes:

I've tested this with multi-page pdf's and gif images, though I'm guessing that multi-page tiff would likely work as well.

For creating your own from scratch, it's easy to convert movies to Image Sequences using Quicktime's Export to Image Sequence ability. From that point one, can use a utility program to create a gif, or use Preview to convert to pdf.

I would think it would be possible to merge a pdf document by using Preview, and according to some unofficial documentation I've read, but when I drop multiple pdf's onto the sidebar in Preview, it doesn't give me a "bound"/merged document. I've used an older free utility called "pdfsam", which will successfully create a merged pdf document with correct ordering.

For the sake of size (and cost of quality), one may want to reopen the merged pdf in Preview and Save using the "Reduce File Size" Quartz Filter option.

The creation of Image Sequence from movie, to merged pdf or gif file seems like something that should be scriptable, to avoid having to use various applications to prep the Image document, but I haven't investigated the automation of that process yet.

Detect end of video playback

jamesbrown's picture

Is there a robust method for detecting the end of video playback in Quartz Composer?

Thank you