Code Monkey home page Code Monkey logo

cameraextension's Introduction

cameraextension

sample camera extension using coremedia io based on code I'm using in my own app Screegle https://www.appblit.com/screegle available on the App Store. This is why this new Camera Extension framework is so good: it lets us ship virtual cameras inside an app bundle that can be distributed on the App Store. And these cameras work in any app on macOS (including Apple's own apps such as FaceTime, QuickTime, Safari, etc.).

this example creates a virtual camera that has 2 streams: a source and a sink stream

  • the source stream is used by apps that want to receive frames from our camera (e.g. QuickTime, Zoom, Safari, etc.)
  • the sink stream is used by our own app to send frames to the virtual camera, which immediately forwards them to its source stream

when the sink stream is not started, the camera simply shows a black frame with a text (+ number of seconds)

when the app runs, it asks the camera (using CoreMediaIO C API in Swift) if its source stream has started (meaning that at least one client such as QuickTime wants to see frames). If so, it starts sending frames to the sink (on our case a static image of Chamonix).

IMPORTANT you'll need to replace the AppBlit team with your own and replace 388X9C8CWR.com.appblit.samplecamera in the 3 places (entitlement files and the Info.plist of the extension).

after you compiled the code, find where it is using Xcode menu Product and Show Build Folder in Finder then open the Build > Products > Debug and drag samplecamera into Applications

From /Applications open samplecamera

Only then will the activate button work

To see the camera working, open for example QuickTime and pick the sample camera. You should see a beautiful picture of Chamonix.

links that can be useful

cameraextension's People

Contributors

ldenoue avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.