GithubHelp home page GithubHelp logo

camera_metal_pro's Introduction

Swift Metal Camera / iOS Metal Video Generator / Metal Image Generation

You are here because you want to...

  1. How to upload camera feed direct to metal kernel/fragment functions.
  2. Give a start with basic Still Image Texture / Camera Metal Texture loading/processing in iOS graphics using metal API(s).
  3. Read a MTLTexture buffer, Then use the buffer to create a CVPixelBuffer/UIImage and whatever you like.
  4. If you are frustrated to understand the metal kernel functionalities and how it should be calculated; then please give a look to this official document from Apple: https://developer.apple.com/documentation/metal/setting_up_a_command_structure
  5. If you would like to read more from the following link then it will be easier to understand the basic of Metal GPU pipeline: https://developer.apple.com/documentation/metal/setting_up_a_command_structure
  6. Metal shaders for blending and applying effects

Meta Video

Basic is grabbed from here :: https://github.com/navoshta/MetalRenderCamera

I grabbed camera session, metal texture cache creation and other setup related code from here. I perform subclassing for MTLCommandEncoder class. I subclassed AVAssetWriter to generate video from MTLTexture. Here are some important notes about the metal rendering process

  1. Metal Texture used for rendering in MTLView is not suitable for generating video/still image.
  2. MTLComputeCommandEncoder is used to process camera feed in metal kernel function.
  3. The output is written to an internal texture for rendering and later video/image generation.
  4. Kernel function subclassing for applying the different effect in live iOS camera stream.
  5. If you would like to add some custom metal effects you my subclass BaseKernelPipelineState and override processArguments(computeEncode:) method.
  • Any Contribution and Suggestion about metal will be highly appreciated.

contact @ [email protected] // +8801675876752

Camera_Metal_Pro

camera_metal_pro's People

Watchers

Nguyen Tuan 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.