QTKit from UNIX app?

  • Probably a naive question, but can I use QTKit (or is there a better library?) to capture images (or videos) inside a UNIX helper application?

    I've never tried using Cocoa (and related) objects outside a regular Cocoa application with a GUI, NSApplicationMain(), etc. Is this generally prohibited?

    Thanks,

    Todd
  • On 9 Jun 2012, at 4:33 PM, Todd Heberlein wrote:

    > I've never tried using Cocoa (and related) objects outside a regular Cocoa application with a GUI, NSApplicationMain(), etc. Is this generally prohibited?

    Not generally prohibited. You can use the Foundation framework in command-line tools. The Xcode template for Mac applications, command-line tools, offers "Foundation" as one of the app types.

    I don't know anything about QTKit. I think I'll try not saying anything about it.

    — F

    --
    Fritz Anderson
    Xcode 4 Unleashed: Don't bring your bathroom copy into the kitchen — were you raised in a barn?
    <http://x4u.manoverboard.org/>
  • On 6/9/12, Todd Heberlein <todd_heberlein...> wrote:
    > Probably a naive question, but can I use QTKit (or is there a better
    > library?) to capture images (or videos) inside a UNIX helper application?
    >
    >
    > I've never tried using Cocoa (and related) objects outside a regular Cocoa
    > application with a GUI, NSApplicationMain(), etc. Is this generally
    > prohibited?
    >
    > Thanks,
    >
    > Todd
    >

    It is possible and reasonable to write command line tools with Cocoa
    (use the Foundation framework). Foundation has no GUI components. I'm
    not sure about QTKit though. It may have GUI components and may
    presume things about having a standard runloop.

    As I mentioned in the other thread, AVFoundation is probably the
    better way forward than QTKit. However, I don't know if how it will do
    in a command line app.

    ImageIO can get you image capabilities without needing a GUI and I
    know that will work.

    -Eric
    --
    Beginning iPhone Games Development
    http://playcontrol.net/iphonegamebook/
  • Hi Todd.

    FWIW, I have a LSBackgroundOnly application that uses QTKit. Instead of NSApplicationMain(), I do [[NSApplication sharedApplication] run].

    Perhaps that's not exactly what you want, but pretty close. It does suggest you might be able to get away with, say, running the run loop manually.

    -Jeff

    On Jun 9, 2012, at 4:33 PM, Todd Heberlein wrote:

    > Probably a naive question, but can I use QTKit (or is there a better library?) to capture images (or videos) inside a UNIX helper application?
    >
    >
    > I've never tried using Cocoa (and related) objects outside a regular Cocoa application with a GUI, NSApplicationMain(), etc. Is this generally prohibited?
    >
    > Thanks,
    >
    > Todd
previous month june 2012 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
Go to today