Coder Social home page Coder Social logo

processing-video-android's Introduction

Processing Video implementation for Android

This library tries to expose the same API endpoints as that of processing-video library for PC. The sketch from processing-video library works for Android.

Demo: https://www.youtube.com/watch?v=kjqcWGLH6Q8

A primitive example :

import in.omerjerk.processing.video.android.*;

Capture cap;

void setup() {
  size(720, 1280, P2D);
  cap = new Capture(this, 720, 1280);
  String[] list = Capture.list();
  //Use this to print list of resolutions supported by the camera
  Capture.printCompatibleResolutionsList(cap);
  cap.setCamera(list[0]);
  cap.start();
}

void draw() {
  image(cap, 0, 0);
}

Behind the hood :

The idea is to render camera preview on a SurfaceTexture and as soon as the new frame is received, copy the data from this SurfaceTexture to a custom texure bound to target GL_TEXTURE_2D (Note : We cannot directly render to a texture bound to GL_TEXTURE_2D target, because for the preview to happen, the texture must be bound to GL_TEXTURE_EXTERNAL_OES). This custom texture is then rendered to a PGraphics object. The backing texture of that PGraphics object is then used as the texture cache for our PImage file which stores the video.

processing-video-android's People

Contributors

omerjerk avatar

Watchers

 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.