PDA

View Full Version : creating output that displays quicktime, quartz, and exports a quicktime clip




Chirone
Mar 16, 2009, 03:58 PM
just wondering if anyone knows how you can export a quicktime movie where there are extra things composited onto the clip (currently done with openGL, but i'm thinking quartz may be able to solve a few text visual issues)

i have found this:
http://developer.apple.com/documentation/QuickTime/Conceptual/QTKitProgrammingGuide/Chapter01/Introduction.html#//apple_ref/doc/uid/TP40001245-CH202-TPXREF101

and this:
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/QuartzComposer/qc_intro/qc_intro.html#//apple_ref/doc/uid/TP40001357-CH201-TPXREF101

but if anyone knows of a tutorial or something that goes through displaying quicktime, compositing quartz onto it, and exporting a new quicktime clip then that would be even better



kainjow
Mar 16, 2009, 10:08 PM
I've never done this myself but I'm guessing you may need to use a combination of Core Video and QuickTime. Quartz Compositions are just OpenGL. You may need to use QCRenderer to draw them into a video manually.

http://developer.apple.com/documentation/GraphicsImaging/Conceptual/CoreVideo/CVProg_Intro/CVProg_Intro.html

Chirone
Mar 17, 2009, 04:31 PM
do you know if its possible to programatically render quartz stuff on top of quicktime in the user interface? (i assume it is since we can render openGL stuff onto of it)

and can quartz create text with outlines and drop shadows if i code it to through objective c?

i've only seen quartz render out normal plain text...

kainjow
Mar 17, 2009, 09:27 PM
When you say "Quartz" do you mean "Quartz Compositions"? Quartz itself is a bit generic, since it can be mean several different things which all use different technologies (which of course all eventually use OpenGL AFAIK).

I think it'd be clearer if you give an example of what you're trying to do.

Chirone
Mar 17, 2009, 09:44 PM
yes, quartz compositions, i wasn't aware there was more two things called quartz (and clearly i'm not talking about the crystal)
my bad

anyway
currently i have an interface that loads in a quicktime clip and displays it using openGL to render it (i think... it's not my code so might get this a little wrong)
right now we can draw various things ontop of the clip, like boxes and all sorts of other things we can draw with OpenGL
the problem is is that the things drawn aren't anti-aliased, despite the line
[gc setShouldAntialias:YES];
where gc is an NSGraphicsContext
might be something to do with the way the code is ordered though. I did try drawing the text as a bigger font and then texturing a smaller square but for some weird reason it was still aliased

but anyway
i thought if i could use quartz compositions i could put some funky things ontop of the quicktime clip which could be changed with our custom interface

either way, whether or not i use quartz compositions i still need to output a quicktime clip

before i go too far down the quartz composition route i'd like to know if it can draw strings.
if it can draw strings can the strings be resized per character.
if it can be resized can i give the strings outlines and drop shadows, and can i blur out the word amd still have nice antialiased text?
If that can be done then can this be done inside of an obj c application
if it can be done inside an obj c app then can i take what i see and output a quicktime clip
if i can output a quicktime clip can i change certain settings like the width and height, and aspect ratios, and also whether or not its progressive or interlaced when the original quicktime is interlaced

does that explain my situation better? sorry for such vague posts

i'm currently trying to find out how to export something from an openGL view as a quicktime clip but with no luck so far

kainjow
Mar 18, 2009, 08:24 AM
While I'm waiting for the iPhone 3.0 SDK to install... :)

yes, quartz compositions, i wasn't aware there was more two things called quartz (and clearly i'm not talking about the crystal)
Well, it's just to avoid confusion since Quartz 2D is very different from Quartz Composer/Compositions.

Quartz 2D is for doing 2D drawing, and that is what NSBezierPath uses, which consists of CGxxx() functions.

Quartz Composer is basically a mesh of every graphics technology in Mac OS X and with plugins you can probably do almost anything with it. It's not always meant as a replacement for writing code - it depends entirely on what you're doing.

right now we can draw various things ontop of the clip, like boxes and all sorts of other things we can draw with OpenGL
the problem is is that the things drawn aren't anti-aliased, despite the line
[gc setShouldAntialias:YES];
where gc is an NSGraphicsContext
might be something to do with the way the code is ordered though. I did try drawing the text as a bigger font and then texturing a smaller square but for some weird reason it was still aliased
It really depends how you're drawing. If you're using Quartz 2D, then the NSGraphicsContext isn't setup unless Cocoa sets it up automatically (in the case of an NSView), or you specifically set it using a current CGContextRef. Plus, this won't affect any OpenGL code at all. It only affects Quartz 2D code.

i thought if i could use quartz compositions i could put some funky things ontop of the quicktime clip which could be changed with our custom interface
I think it would work the other way around. You would use Quartz Composer to put effects onto a movie (which is really just using Core Video/Image).

either way, whether or not i use quartz compositions i still need to output a quicktime clip
QTKit (or the C QuickTime APIs) should do this either way.

before i go too far down the quartz composition route i'd like to know if it can draw strings.
if it can draw strings can the strings be resized per character.
if it can be resized can i give the strings outlines and drop shadows, and can i blur out the word amd still have nice antialiased text?
If that can be done then can this be done inside of an obj c application
if it can be done inside an obj c app then can i take what i see and output a quicktime clip
if i can output a quicktime clip can i change certain settings like the width and height, and aspect ratios, and also whether or not its progressive or interlaced when the original quicktime is interlaced

does that explain my situation better? sorry for such vague posts

i'm currently trying to find out how to export something from an openGL view as a quicktime clip but with no luck so far
I think what you really need is to read the docs on Core Video and Core Image. Look up applying filters and such to a video, and/or custom rendering into frames. I know it's all possible, but I don't know specifically how to do it all. You just need to spend some time in the docs getting an understanding of what technology does what. There's a lot of sample code on Apple's website too that deals with all these techs. This isn't a trivial task you're trying to do here.

If you want to manipulate text, you probably want to use Quartz 2D and somehow mix that in.

And of course it can all be done in an Objective-C app :)

Chirone
Mar 18, 2009, 03:13 PM
thanks for such an informative response!

looks like i'll be bathing with the docs a fair bit for a long while...

Chirone
Mar 18, 2009, 10:43 PM
ok, here's something i've found

i have been able to do the things i want to do with Quartz2D other than display a QuickTime Clip at the original or scaled dimensions

i have found example code of playing QuickTime clips, but it uses OpenGL

from what I gather the OpenGL requires me to make an OpenGL context, which i'm guessing isn't going to be the same as the Quartz2D context

the new question is, how can i get Quartz2D to play a QuickTime clip?

the age old question of how to get the program to export a quicktime clip from what i see from the quartz 2d context still exists as well...

if anyone has any ideas feel free to share :)


edit:
i found the quicktime class, and it looks like there is a method that allows me to get a image at a certain time of the clip and returns an NSImage
is it possible to put this NSImage inside of the context for Quartz2D and then export it?