Giter VIP home page Giter VIP logo

v4l2_android's Introduction

Q:为什么使用v4l2,而不用camera api

A:相对而言,如果系统支持,使用系统api是最稳定的,但当你插入多个usb摄像头,而你需要打开指定摄像头的时候,系统的api往往不好使,它们只有0,1,2这样的id,不能区分摄像头型号

Q:我的设备能不能使用这个

A:你的设备拥有root权限,并且插入usb摄像的时候生成了/dev/videoX节点,那么即可正常使用

这个使用起来非常简单,kotlin代码

var v4L2: V4L2 = V4L2()
v4L2.open("/dev/video1", 1920, 1080)

然后不断的取回数据,内部取的是mjpeg,turbojpeg解码

var bitmap: Bitmap?
synchronized(lock) {
    bitmap = v4L2.nextFrame()
}

关闭释放资源

synchronized(lock) {
    v4L2.close()
}

具体使用方式可以查看代码

截图

v4l2_android's People

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.