Giter Site home page Giter Site logo

saki4510t / uvccamera Goto Github PK

View Code? Open in Web Editor NEW
3.0K 144.0 1.2K 12.88 MB

library and sample to access to UVC web camera on non-rooted Android device

Makefile 3.93% C++ 9.71% C 46.10% Shell 4.74% Assembly 14.66% Java 7.81% HTML 7.71% Batchfile 0.09% CMake 0.53% CSS 0.47% JavaScript 0.38% M4 0.39% Objective-C 0.01% PHP 3.07% Roff 0.40%

uvccamera's Introduction

UVCCamera

library and sample to access to UVC web camera on non-rooted Android device

Copyright (c) 2014-2017 saki [email protected]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

All files in the folder are under this Apache License, Version 2.0. Files in the jni/libjpeg, jni/libusb and jin/libuvc folders may have a different license, see the respective files.

How to compile library

The Gradle build system will build the entire project, including the NDK parts. If you want to build with Gradle build system,

  1. make directory on your favorite place (this directory is parent directory of UVCCamera project).
  2. change directory into the directory.
  3. clone this repository with git clone https://github.com/saki4510t/UVCCamera.git
  4. change directory into UVCCamera directory with cd UVCCamera
  5. build library with all sample projects using gradle build

It will takes several minutes to build. Now you can see apks in each {sample project}/build/outputs/apks directory.
Or if you want to install and try all sample projects on your device, run gradle installDebug.

Note: Just make sure that local.properties contains the paths for sdk.dir and ndk.dir. Or you can set them as enviroment variables of you shell. On some system, you may need add JAVA_HOME envairoment valiable that points to JDK directory.

If you want to use Android Studio(unfortunately NDK supporting on Android Studio is very poor though),

  1. make directory on your favorite place (this directory is parent directory of UVCCamera project).
  2. change directory into the directory.
  3. clone this repository with git clone https://github.com/saki4510t/UVCCamera.git
  4. start Android Studio and open the cloned repository using Open an existing Android Studio project
  5. Android Studio raise some errors but just ignore now. Android Studio generate local.properties file. Please open local.properties and add ndk.dir key to the end of the file. The contents of the file looks like this.
sdk.dir={path to Android SDK on your storage}
ndk.dir={path to Android SDK on your storage}

Please replace actual path to SDK and NDK on your storage.
Of course you can make local.properties by manually instead of using automatically generated ones by Android Studio. 6. Synchronize project 7. execute Make project from Build menu.

If you want to use build-in VCS on Android Studio, use Check out project from Version Control from https://github.com/saki4510t/UVCCamera.git. After cloning, Android Studio ask you open the project but don't open now. Instead open the project using Open an existing Android Studio project. Other procedures are same as above.

If you still need to use Eclipse or if you don't want to use Gradle with some reason, you can build suing ndk-build command.

  1. make directory on your favorite place.
  2. change directory into the directory.
  3. clone this repository with git clone https://github.com/saki4510t/UVCCamera.git
  4. change directory into {UVCCamera}/libuvccamera/build/src/main/jni directory.
  5. run ndk-build
  6. resulted shared libraries are available under {UVCCamera}/libuvccamera/build/src/main/libs directory and copy them into your project with directories by manually.
  7. copy files under {UVCCamera}/libuvccamera/build/src/main/java into your project source directory by manually.

How to use

Please see sample project and/or our web site(but sorry web site is Japanese only). These sample projects are IntelliJ projects, as is the library. This library works on at least Android 3.1 or later(API >= 12), but Android 4.0(API >= 14) or later is better. USB host function must be required. If you want to try on Android 3.1, you will need some modification(need to remove setPreviewTexture method in UVCCamera.java etc.), but we have not confirm whether the sample project run on Android 3.1 yet. Some sample projects need API>=18 though.

2014/07/25

Add some modification to the library and new sample project named "USBCameraTest2". This new sample project demonstrate how to capture movie using frame data from UVC camera with MediaCodec and MediaMuxer. New sample requires at least Android 4.3(API>=18). This limitation does not come from the library itself but from the limitation of MediaMuxer and MediaCodec#createInputSurface.

2014/09/01

Add new sample project named USBCameraTest3 This new sample project demonstrate how to capture audio and movie simultaneously using frame data from UVC camera and internal mic with MediaCodec and MediaMuxer. This new sample includes still image capturing as png file.(you can easily change to save as jpeg) This sample also requires at least Android 4.3(API>=18). This limitation does not come from the library itself but from the limitation of MediaMuxer and MediaCodec#createInputSurface.

2014/11/16

Add new sample project named USBCameraTest4 This new sample project mainly demonstrate how to use offscreen rendering and record movie without any display. The communication with camera execute as Service and continue working even if you stop app. If you stop camera communication, click "stop service" button.

2014/12/17

Add bulk transfer mode and update sample projects.

2015/01/12

Add wiki page, HowTo

2015/01/22

Add method to adjust preview resolution and frame data mode.

2015/02/12

Add IFrameCallback interface to get frame data as ByteArray and new sample project USBCameraTest5 to demonstrate how to use the callback method.

2015/02/18

Add libUVCCamera as a library project(source code is almost same as previous release except Android.mk). All files and directories under library directory is deprecated.

2015/05/25

libraryProject branch merged to master.

2015/05/30

Fixed the issue that DeviceFilter class could not work well when providing venderID, productID etc.

2015/06/03

Add new sample project named USBCameraTest6 This new sample project mainly demonstrate how to show video images on two TextureView simultaneously, side by side.

2015/06/10

Fixed the issue of pixel format is wrong when NV21 mode on calling IFrameCallback#onFrame(U and V plane was swapped) and added YUV420SP mode.

2015/06/11

Improve the issue of USBCameraTest4 that fails to connect/disconnect.

2015/07/19

Add new methods to get/set camera features like brightness, contrast etc.
Add new method to get supported resolution from camera as json format.

2015/08/17

Add new sample project USBCameraTest7 to demonstrate how to use two camera at the same time.

2015/09/20

Fixed the issue that building native libraries fail on Windows.

2015/10/30

Merge pull request(add status and button callback). Thanks Alexey Pelykh.

2015/12/16

Add feature so that user can request fps range from Java code when negotiating with camera. Actual resulted fps depends on each UVC camera. Currently there is no way to get resulted fps(will add on future).

2016/03/01

update minoru001 branch, experimentaly support streo camera.

2016/06/18

replace libjpeg-turbo 1.4.0 with 1.5.0

2016/11/17

apply bandwidth factor setting of usbcameratest7 on master branch

2016/11/21

Now this repository supports Android N(7.x) and dynamic permission model of Android N and later.

2017/01/16

Add new sample app usbCameraTest8 to show how to set/get uvc control like brightness

2017/04/17

Add new sample app on OpenCVwithUVC repository. This shows the way to pass video images from UVC into cv::Mat (after optional applying video effect by OpenGL|ES) and execute image processing by OpenCV.

uvccamera's People

Contributors

alexey-pelykh avatar bryant1410 avatar rehlma avatar saki4510t avatar w-shackleton avatar wf9a5m75 avatar zoltanpillio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uvccamera's Issues

Exposure control

Hi!

I'm working on a project where we use and older fork of your code where exposure control is still available and it does weird things.
First of all may I ask why setting exposure time is not exposed in the code currently on master is there a reason for it? I did check other controls with the cameras we have here and they work fine, gain control / brightness control however changing exposure may do the following things depending on the camera:

  • image disappears if you try to set the exposure
  • exposure setting is different based on the camera in some cases it's from say -16 to -1 or a time in milli seconds, I guess this is related to the UVC version used by the camera if so how can I get the UVC version used by the camera attached.
  • setting the exposure level breaks the camera meaning that I can set the exposure once which works then exiting the app, stopping the preview will make the camera stuck in a state where it acts as if it were told to use some super high exposure, however reconnecting the camera fixes the isssue
  • in some cases the exposure setting doesn't work after setting it once, so any subsequent changes will have no effect until you reconnect the camera.

Support for RockChip RK3288

Hi Saki,

I had read in your other web comments that your UVC camera software was not compatible with the RockChip RK8233. Have you made any progress with fixing this issue?

I have recently purchased a PIPO 7 tablet which is great for debugging/developing USB host code on an Android tablet since this device has separate micro USB connectors for both HOST and DEVICE plus also has a separate charging plug. However, as you know, I only get black images from my external stereo USB Webcams.

Actually for the code that I am developing I only need bulk transfer still images from each of the cameras and I process these images, in a tight loop, with OpenCV. Do you know a way I could get the images from my two Webcams (Minoru) using bulk transfer and bypassing the UVC - RK8233 issues?

Question about iFrameCallback

I want to pass the frame to another library that is compatible with the android camera API. This uses a byte[] of yuv frames.

How can I convert the ByteBuffer to a properly formatted yuv_image byte array?

日本語でも英語でも大丈夫です。

camera.setPreviewCallbackWithBuffer(new Camera.PreviewCallback() {
       @Override
       public void onPreviewFrame(byte[] yuv_image, Camera camera) {
       }
});

versus

mUVCCamera.setFrameCallback(new IFrameCallback() {
        @Override
        public void onFrame(final ByteBuffer frame) {
        }              
}, 
UVCCamera.PIXEL_FORMAT_NV21);

onAttach(UsbDevice device)

Hi Saki,

Once again, thanks for the great library and quick responses.
I was trying to implement the code in your cover page with the description "How to start app when user connect UVC device to Android device" and was not able to get the interface callback onAttach() to work. The onConnect() etc. works correctly. I noticed that I could not get the onAttach() toast window to show in any of your examples either. The code that I am designing is a derivative of your USBCameraTest7 and I am using a Acer B1-730HD tablet based on a dual core Atom processor. I am developing the app under Android Studio. Can you give me any ideas as to how to debug my issue?
Ad_thanks_vance.

libusb_submit_transfer return -1

hi,saki
i am trying 3 cameras and got this error in Stream.c (uvc_stream_start_bandwidth).
each camera i use MJPEG mode,just can display 2 cameras,the last one is error.

stream.c:1576:uvc_stream_start_bandwidth]:ret(-1) != UVC_SUCCESS(0)==>libusb_submit_transfer failed
stream.c:1591:uvc_stream_start_bandwidth]:fail

Another case, i use 2 camera as YUV, then have the same error, i don't know why(Please forgive me my c++ is so poor :) )?

Requesting USB permission failed on Samsung's Android5.1.1

As I know, android.hardware.usb.UsbManager#requestPermission always throws java.lang.SecurityException related to android.permission.sec.MDM_APP_MGMT on Samsung's Android5.1.1 and never get USB access permission on those devices now.

java.lang.SecurityException: Admin  does not have android.permission.sec.MDM_APP_MGMT
    at android.os.Parcel.readException(Parcel.java:1546)
    at android.os.Parcel.readException(Parcel.java:1499)
    at android.hardware.usb.IUsbManager$Stub$Proxy.requestDevicePermission(IUsbManager.java:653)
    at android.hardware.usb.UsbManager.requestPermission(UsbManager.java:432)

saki

Epson moverio bt-200 could not open camera!

Hi,

Thanks for your efforts!
I tried to test "usbCameraTest" and "usbCameraTest0" and they ran successfully in my phone (Samsung galaxy note 3 / android 5.0) but when i try to run or compile them in my Epson Moverio BT-200 glasses it can find the camera but fails with "could not open camera:err=-99" error!
I tried using different parameters for width, height, fps etc but nothing happened... :(
any help or comment on how to solve this issue would be greatly appreciated!
thanks

Camera Button click

I have been trying to get button on camera get snap of the picture get triggered.
but failing continuously.

Help would be very appreciated.

Thank you,
ahmgsk

UVCCamera7 not always works on my samsung s4.

UVCCamera7 works good on webcam C270 for first time. But After Some time UVCCamera7 dialogs "No USB Camera found" message. Some times it working , some time not , I don't know that what is the exact reason for this errror and i not able to find solution for that.

I got the same problem when i tested using webcam pro 9000.
screenshot_2016-03-03-12-55-08

Unity3d support

Hi, You have any idea for making a jar file from the .so library ? so i can use it in unity3d to make use of this?

Can't change brightness, contrast with new method released on 2015/07/19

Hi Saki-san.

I tried to change the brightness using mUVCCamera.setBrightness(10) or some other value such as 80, but the brightness was not change. When I checked with mUVCCamera.getBrightness(), the returned value was 0. I did the same on setContrast, the problem was the same.

Kindly let me know if I have done anything wrong.

Thanks !

Best regards,
BL

FPS Support + Higher Resolutions

Hi,

i've modified the sources and recompiled the libs to support dynamic frame rates.
everything works, but when i choose a resolution higher than 640x480 (e.g. 1280x720@60fps@mjpeg) the preview starts lagging.
what can i do to make the preview smooth?

thank you

[question] Take a picture

What is the best way to capture a single snapshot with the USB camera without processing all the video stream? Is there a function in the API to take a picture? Thank you for your help.

USB 3.0 not working

I'm trying to connect Video grabber (HDMI to USB 3.0 Inogeni device) to Nvidia Shield TV. I can see the preview using USB 2.0. But when I connect to USB 3.0 port, I see following error:
E/libUVCCamera﹕ [4528*UVCCamera.cpp:110:connect]:could not open camera:err=-12

usbCameraTest7 - Minuro Dual WebaCam Previews

Hi Saki,
I'm running usbCameraTest7 on nexus 5 with Minuro webcam via OTG cable.
the app runs, both camera seems to be active according to the lights on the camera but there is no preview on screen.

I saw a closed issue on this, but I still have and issue, so opening a new one.

Will appreciate your support.
Thanks,
Ofer

logcat (short one):
10-29 15:07:28.944: W/InputMethodManagerService(773): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4325aa80 attribute=null, token = android.os.BinderProxy@4330dc20
10-29 15:07:28.954: I/EventHub(773): Removing device '/dev/input/event6' due to inotify event
10-29 15:07:28.954: I/EventHub(773): Removed device: path=/dev/input/event6 name=Vimicro USB2.0 PC Camera id=16 fd=93 classes=0x80000001
10-29 15:07:28.964: I/InputReader(773): Device removed: id=16, name='Vimicro USB2.0 PC Camera', sources=0x00000101
10-29 15:07:28.974: I/libUVCCamera(4667): [4726_UVCPreview.cpp:477:prepare_preview]:frameSize=(640,480)@yuyv
10-29 15:07:31.824: D/dalvikvm(1834): GC_CONCURRENT freed 1112K, 7% free 17966K/19208K, paused 3ms+3ms, total 15ms
10-29 15:07:31.904: D/dalvikvm(1834): GC_CONCURRENT freed 374K, 7% free 18016K/19208K, paused 2ms+1ms, total 12ms
10-29 15:07:32.594: D/audio_hw_primary(189): select_devices: out_snd_device(2: speaker) in_snd_device(0: )
10-29 15:07:35.664: W/InputMethodManagerService(773): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@42c93aa8 attribute=null, token = android.os.BinderProxy@4330dc20
10-29 15:07:35.674: I/EventHub(773): Removing device '/dev/input/event7' due to inotify event
10-29 15:07:35.674: I/EventHub(773): Removed device: path=/dev/input/event7 name=Vimicro USB2.0 PC Camera id=17 fd=94 classes=0x80000001
10-29 15:07:35.694: I/InputReader(773): Device removed: id=17, name='Vimicro USB2.0 PC Camera', sources=0x00000101
10-29 15:07:35.694: I/libUVCCamera(4667): [4738_UVCPreview.cpp:477:prepare_preview]:frameSize=(640,480)@yuyv

Device Has OTG support but camera not getting detected

Hi

I Have an android device which has USB OTB support(I am able to use my pen-drive) But when I connect a camera which is working fine on some other Android devices not getting detected. Do you have any idea.? Is there any way to get it detected.?

Power consumption problem?

Hi Saki,
and first of all thanks for your work !

I'm facing a little problem when connecting a camera (Logitech HD Webcam C525) to my tablet (Nexus 10 Android 5.1.1).

The image appears for 3-4 frames (less than 1 second), then the camera shut down (no more red led telling that the camera is acquiring data).

It sounds like a problem of power consumption, the camera needing more energy than the tablet can deliver.
But in another application from the playstore (cameraFi), it works well. After that, I tried again tests activities and it works correctly.

So I'm wordering what is the extra work done by this application to handle correctly camera?
Is there something to do in a specific content provider?

usbCameratest7 cleanup

Hi saki,
I have noticed that there is some inconsistency in your project structure. usbCameratest7 is the only sample project where the first 't' is in lower case, all other projects have a uppercase 'T'. Nevertheless, the file usbCameraTest7.iml has a uppercase 'T' just as the others. This messes up the AndroidStudio setup. Everytime I include this project, AndroidStudio creates a usbCameraTest7 Folder (note the upper case 'T') and searches for all files in that folder, of course without success.
Could you please clean this up in your master branch? Renaming the folder 'usbCameratest7' to 'usbCameraTest7' resolves all issues.
Thanks!

Not recognizing the camera "ELP"

Hello, Saki,
thank you very much for your library!
I have 2 cameras and 2 phones, the lib works perfectly with my first camera on both phones, but there is the problem with this one:
http://www.ebay.co.uk/itm/221925190603?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
(the manufacturer is "ELP" (brand) - Ailipu Technology Co.,Ltd).
Neither your library, nor your "UsbWebCamera" app from Google Play doesn't work with this camera. The app/lib doesn't recognize it and even doesn't ask to permit its usage.
At the same time, the CameraFi app works properly with this camera (https://play.google.com/store/apps/details?id=com.vaultmicro.camerafi).
Maybe could you suggest what could be a reason and how can this problem be solved?
Just in case (but I assume it does not affect): I use phones Moto G II gen (Android ver. 5.1) & Vodafone Smart ultra 6 (Android ver. 5.1.1).

Random could not open camera with errors -2 and -50

Hi saki,
I am having problems with a camera of mine. Sometimes it works fine, other times not (error message: could not open camera:err=-2 or -50). I cannot distinguish any dependencies on other circumstances, sometimes the error is thrown, other times the preview is ok.
Information: I am using an edited version of sample 7, but the error -2 shows up in an unchanged version of sample 7 as well.
I can not figure out what the errors mean, do you have an idea?

Also, in my version I do not want any user interface. If a camera is connected, the preview should start on any free surface (max 2 at a time). However I noticed that in the onAttach Method of the OnDeviceConnectListener Interface I implemented, I always get device == null. I have to iterate through all connected devices with:
for(UsbDevice d : mUSBMonitor.getDeviceList())
and request permission for all of them. Do you have an idea why the method is not called with the device that was most recently connected but with null instead?

Thanks in advance for your help!

USBCameraTest3 - How to make video files streamable?

I am currently writing a modified version of USBCameraTest3 with playback, and would like to use a VideoView for playback. However, today I just found out that the created video files are non-streamable, as I get the error "Can't play this video" when loading the video into my VideoView. Apparently VideoView requires streamable video files.

I was wondering, what changes should I make to make my output video files streamable?

Dual camera not working with Silicon Motion camera.

I have 2x DBPower endoscope cameras, which have a Silicon Motion chipset - unfortunately I cannot get them both to work with usbcameratest7 - one appears fine, but not both. I have tried the minoru branch and none of them get displayed. Here's a dump of the device with lsusb on Linux:

$ sudo lsusb -s 002:004 -v

Bus 002 Device 004: ID 090c:f37d Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Endoscope camera
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 ?
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x090c Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.)
idProduct 0xf37d Endoscope camera
bcdDevice 0.04
iManufacturer 1 SMI
iProduct 2 USB 2.0 Camera
iSerial 3 webcam
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 695
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 14 Video
bFunctionSubClass 3 Video Interface Collection
bFunctionProtocol 0
iFunction 1 SMI
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 1 Video Control
bInterfaceProtocol 0
iInterface 1 SMI
VideoControl Interface Descriptor:
bLength 13
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdUVC 1.00
wTotalLength 77
dwClockFrequency 30.000000MHz
bInCollection 1
baInterfaceNr( 0) 1
VideoControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Camera Sensor
bAssocTerminal 0
iTerminal 0
wObjectiveFocalLengthMin 0
wObjectiveFocalLengthMax 0
wOcularFocalLength 0
bControlSize 3
bmControls 0x00000000
VideoControl Interface Descriptor:
bLength 26
bDescriptorType 36
bDescriptorSubtype 6 (EXTENSION_UNIT)
bUnitID 2
guidExtensionCode {92423946-d10c-e34a-8783-3133f9eaaa3b}
bNumControl 8
bNrPins 1
baSourceID( 0) 3
bControlSize 1
bmControls( 0) 0xff
iExtension 0
VideoControl Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 5 (PROCESSING_UNIT)
Warning: Descriptor too short
bUnitID 3
bSourceID 1
wMaxMultiplier 0
bControlSize 2
bmControls 0x0000157f
Brightness
Contrast
Hue
Saturation
Sharpness
Gamma
White Balance Temperature
Backlight Compensation
Power Line Frequency
White Balance Temperature, Auto
iProcessing 0
bmVideoStandards 0x 9
None
SECAM - 625/50
VideoControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 4
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 2
iTerminal 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 16
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
VideoStreaming Interface Descriptor:
bLength 15
bDescriptorType 36
bDescriptorSubtype 1 (INPUT_HEADER)
bNumFormats 2
wTotalLength 443
bEndPointAddress 129
bmInfo 0
bTerminalLink 4
bStillCaptureMethod 2
bTriggerSupport 0
bTriggerUsage 0
bControlSize 1
bmaControls( 0) 11
bmaControls( 1) 11
VideoStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 6 (FORMAT_MJPEG)
bFormatIndex 1
bNumFrameDescriptors 6
bFlags 1
Fixed-size samples: Yes
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 1 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 147456000
dwMaxBitRate 147456000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 333333
bFrameIntervalType 1
dwFrameInterval( 0) 333333
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 2
bmCapabilities 0x00
Still image unsupported
wWidth 320
wHeight 240
dwMinBitRate 36864000
dwMaxBitRate 36864000
dwMaxVideoFrameBufferSize 153600
dwDefaultFrameInterval 333333
bFrameIntervalType 1
dwFrameInterval( 0) 333333
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 3
bmCapabilities 0x00
Still image unsupported
wWidth 800
wHeight 600
dwMinBitRate 230400000
dwMaxBitRate 230400000
dwMaxVideoFrameBufferSize 960000
dwDefaultFrameInterval 333333
bFrameIntervalType 1
dwFrameInterval( 0) 333333
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 4
bmCapabilities 0x00
Still image unsupported
wWidth 1024
wHeight 768
dwMinBitRate 377487360
dwMaxBitRate 377487360
dwMaxVideoFrameBufferSize 1572864
dwDefaultFrameInterval 333333
bFrameIntervalType 1
dwFrameInterval( 0) 333333
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 5
bmCapabilities 0x00
Still image unsupported
wWidth 1280
wHeight 720
dwMinBitRate 442368000
dwMaxBitRate 442368000
dwMaxVideoFrameBufferSize 1843200
dwDefaultFrameInterval 333333
bFrameIntervalType 1
dwFrameInterval( 0) 333333
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 6
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 147456000
dwMaxBitRate 147456000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 333333
bFrameIntervalType 1
dwFrameInterval( 0) 333333
VideoStreaming Interface Descriptor:
bLength 26
bDescriptorType 36
bDescriptorSubtype 3 (STILL_IMAGE_FRAME)
bEndpointAddress 0
bNumImageSizePatterns 5
wWidth( 0) 1280
wHeight( 0) 720
wWidth( 1) 320
wHeight( 1) 240
wWidth( 2) 800
wHeight( 2) 600
wWidth( 3) 1024
wHeight( 3) 768
wWidth( 4) 640
wHeight( 4) 480
bNumCompressionPatterns 5
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
VideoStreaming Interface Descriptor:
bLength 27
bDescriptorType 36
bDescriptorSubtype 4 (FORMAT_UNCOMPRESSED)
bFormatIndex 2
bNumFrameDescriptors 5
guidFormat {59555932-0000-1000-8000-00aa00389b71}
bBitsPerPixel 16
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 2 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 147456000
dwMaxBitRate 147456000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 333333
bFrameIntervalType 1
dwFrameInterval( 0) 333333
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 2
bmCapabilities 0x00
Still image unsupported
wWidth 320
wHeight 240
dwMinBitRate 36864000
dwMaxBitRate 36864000
dwMaxVideoFrameBufferSize 153600
dwDefaultFrameInterval 333333
bFrameIntervalType 1
dwFrameInterval( 0) 333333
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 3
bmCapabilities 0x00
Still image unsupported
wWidth 1280
wHeight 1024
dwMinBitRate 157286400
dwMaxBitRate 157286400
dwMaxVideoFrameBufferSize 2621440
dwDefaultFrameInterval 1333333
bFrameIntervalType 1
dwFrameInterval( 0) 1333333
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 4
bmCapabilities 0x00
Still image unsupported
wWidth 1600
wHeight 1200
dwMinBitRate 92160000
dwMaxBitRate 92160000
dwMaxVideoFrameBufferSize 3840000
dwDefaultFrameInterval 3333333
bFrameIntervalType 1
dwFrameInterval( 0) 3333333
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 5
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 147456000
dwMaxBitRate 147456000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 333333
bFrameIntervalType 1
dwFrameInterval( 0) 333333
VideoStreaming Interface Descriptor:
bLength 22
bDescriptorType 36
bDescriptorSubtype 3 (STILL_IMAGE_FRAME)
bEndpointAddress 0
bNumImageSizePatterns 4
wWidth( 0) 1600
wHeight( 0) 1200
wWidth( 1) 1280
wHeight( 1) 1024
wWidth( 2) 320
wHeight( 2) 240
wWidth( 3) 640
wHeight( 3) 480
bNumCompressionPatterns 4
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x1400 3x 1024 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 2
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x1380 3x 896 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 3
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0b80 2x 896 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 4
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0b00 2x 768 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 5
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0a80 2x 640 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 6
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0380 1x 896 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 7
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0300 1x 768 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 8
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0280 1x 640 bytes
bInterval 1
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 ?
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)

What could be the issue here?

Regards.

UnsatisfiedLinkError on Samsung Galaxy Tab 3

I am currently using your library, and for some reason, I tested it with a Samsung Galaxy Tab 3, and I am getting an UnsatisfiedLinkError when I try to open the camera.

The Tab 3 runs Android 4.4.2.

I wonder if the Intel Atom processor could have something to do with it. It works fine on a Samsung Galaxy Tab 4, which has an ARM architecture processor.

Contact Project Owner

Hi,

the projects is very promising and we would like to start contributing. Would you mind getting in contact with me?

Best,

Moritz from Pupil Labs

Sample projects crash after selecting UVC camera

Hello,

I'm an electrical engineer new to Android development.
We're trying to control a UVC camera on Android for a health technology application.

Anyways I compiled couple sample projects (#0, #6) from the library into .apk and installed on a Nexus.
When running the apps I was able to see and select the attached UVC camera, but the apps crashed right after I did so.
However the app CameraFi (which was created also by authors of UVCCamera) worked fine on my Nexus.

Possibly my NDK compiler is not working properly.
Can someone send me compiled .apk for any of the sample projects within the library?
Any other suggestions?

Thanks!

Cannot compile library ndk-build

Ths for this nice tools !

I can't compile the library using ndk-build : error

CreateProcess(NULL, D:/android-ndk-r11c-windows-x86/android-ndk-r11c/build//../toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -MMD -MP -MF D:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/obj/local/armeabi/objs/UVCCamera/_onload.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -O2 -g -DNDEBUG -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/UVCCamera/ -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/UVCCamera/../ -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/UVCCamera/../rapidjson/include -ID:/android-ndk-r11c-windows-x86/android-ndk-r11c/build//../sources/cxx-stl/system/include -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/libusb/android/jni/../../ -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/libusb/android/jni/../../libusb -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/libuvc/android/jni/../../ -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/libuvc/android/jni/../../include -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/libuvc/android/jni/../../include/libuvc -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/libjpeg-turbo-1.4.0/ -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/UVCCamera -DANDROID -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/UVCCamera/ -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/UVCCamera/../ -ID:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/UVCCamera/../rapidjson/include -DANDROID_NDK -DLOG_NDEBUG -DACCESS_RAW_DESCRIPTORS -O3 -fstrict-aliasing -fprefetch-loop-arrays -Wa,--noexecstack -Wformat -Werror=format-security -isystem D:/android-ndk-r11c-windows-x86/android-ndk-r11c/build//../platforms/android-14/arch-arm/usr/include -c D:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/jni/UVCCamera/_onload.cpp -o D:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/obj/local/armeabi/objs/UVCCamera/_onload.o, ...) failed.
make (e=2): Le fichier spécifié est introuvable.

make: *** [D:/eclipse-SDK-4.2.2-win32-x86_64/Workspace/main/obj/local/armeabi/objs/UVCCamera/_onload.o] Error 2

I need your help to recompile and have the .so files to run the samples.

Kdt

Isochronos EPROTO errors

When trying out the UVCCamera on a N10 (4.4.4) using a UVC capture device, I am getting EPROTO errors in handle_iso_completion.
The symptoms are in the preview video display, it stutters, as any frames with the EPROTO packets are dropped.
If I ignore the errors, then the frames have obviously suffered missing data as you get green glitches.
Any ideas for solving the EPROTO errors?

Android 5.0 support

OK, not a problem with the current code, but I have been using a modified uvc_init to pass in the USB FS path to try and get Android 5.0 working:
uvc_error_t uvc_init2(uvc_context_t *_pctx, struct libusb_context *usb_ctx, char *uspFs)
Based on the work done by https://github.com/martinmarinov/rtl_tcp_andro-
This calls though to:
int API_EXPORTED libusb_init2(libusb_context *_context, const char * uspfs_path_input)

This does indeed get things further, but the uvc_open is doing something strange. The libusb_device pointer is getting corrupted at some point and overwritten with 0x12507.
This is consistent and I can move the problem a bit by creating a uvc_device structure with a copy of the dev object returned from the uvc_find2.
Any ideas welcome...

Project uses Eclipse build system

It would be nice if this project used IntelliJ and Gradle.

I'm about to do this conversion for my own benefit (I've had experience porting NDK projects to Gradle) in my fork of this project. Just giving you a heads up!

It would also be nice if we put this project on jcenter / maven central

error when build on windows

the build.gradle can't work well on windows.

task ndkBuild in your build.gradle could be better:

import org.apache.tools.ant.taskdefs.condition.Os
task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
    def ndkDir = project.plugins.findPlugin('com.android.library').sdkHandler.getNdkFolder()
    println(ndkDir)
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        commandLine "$ndkDir/ndk-build.cmd",
                'NDK_PROJECT_PATH=build',
                'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
                'NDK_APPLICATION_MK=src/main/jni/Application.mk',
                '-j8'
    }
    else {
        commandLine "$ndkDir/ndk-build",
                'NDK_PROJECT_PATH=build',
                'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
                'NDK_APPLICATION_MK=src/main/jni/Application.mk',
                '-j8'
    }
}

than:

task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
    def ndkDir = project.plugins.findPlugin('com.android.library').sdkHandler.getNdkFolder()
    println(ndkDir)
    commandLine "$ndkDir/ndk-build",
            'NDK_PROJECT_PATH=build',
            'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
            'NDK_APPLICATION_MK=src/main/jni/Application.mk',
            '-j8'
}

Refer to:https://stackoverflow.com/questions/27477158/android-studio-ndk-build-trouble-errorexecution-failed-for-task-appbuildnati

missing support for "arm64-v8a" and "x86_64" and "mips64".

When I use this library in my program,it will report errors with lack of "libusb100.so".
The error I think it caused by lack of 64 bit "libusb100.so". support.Such as "arm64-v8a" and "x86_64" and "mips64".
Thanks your great working~

Web cam is not working in Lenovo A3300-hv tab.

Thank you for this great open source library. I am using this library to start a UVC compliant web camera in android. It is working fine in some android devices and in other android device like Lenovo A3300-hv I am facing a an issue in receiving a frame from a UVC compliant web Camera. Tab is rooted and has a Video4Linux enabled custom kernel with Mediatek chip set.

Some of UVC compliant camera is working by downgrading the resolution and some are not working.

Application get stucked in "_uvc_user_caller()" function at "pthread_cond_wait(&strmh->cb_cond, &strmh->cb_mutex);" .

Can you please tell me the reason why I am not receiving any frame from a Camera.

Please find attached log file.
Applog.txt

Multiple Cameras/Previews

Hi,
I started from USBCameraTest6 and tried to get it to show two cameras at once. I duplicated the camera button, the USBMonitor and the UVCCameraHandler. I am at the point that I have two CameraViews with a Camera Button on top of each of them. This works fine, as long as I only start one camera at a time. When I try to start the second camera while one is already running, the preview will not start.
What do I have to do to get two previews simultaneously with your library? Is this even possible?
Thank you!

Sample projects dont work after selecting UVC camera

Sample projects dont work after selecting UVC camera. The screen has no image. Then about 30 seconds ,it crashed.
the logcat is blow:


12-14 11:32:54.451 13135-13135/com.Beyondh V/MainActivity: onResume:
12-14 11:32:54.681 13135-13135/com.Beyondh D/OpenGLRenderer: Enabling debug mode 0
12-14 11:32:54.691 13135-13135/com.Beyondh V/MainActivity: surfaceCreated:
12-14 11:32:54.691 13135-13135/com.Beyondh V/MainActivity: surfaceChanged:
12-14 11:36:24.201 13135-13135/com.Beyondh V/MainActivity: onConnect:
12-14 11:36:24.221 13135-16199/com.Beyondh I/MainActivity: supportedSize:{"formats":[{"index":1,"type":4,"default":1,"size":["640x480","352x288","320x240","176x144","160x120"]},{"index":2,"type":6,"default":1,"size":["640x480","352x288","320x240","176x144","160x120"]}]}
12-14 11:36:24.231 13135-16202/com.Beyondh I/libUVCCamera: [16202*UVCPreview.cpp:489:prepare_preview]:frameSize=(640,480)@MJPEG
12-14 11:36:24.241 13135-16204/com.Beyondh W/art: Thread[16,tid=16204,Native,Thread*=0x449ea220,peer=0x64850468,"Thread-289"] attached without supplying a name
12-14 11:36:24.241 13135-16204/com.Beyondh I/libUVCCamera: [16204*UVCPreview.cpp:259:callbackPixelFormatChanged]:PIXEL_FORMAT_YUV:
12-14 11:37:05.311 13135-16201/com.Beyondh A/libc: Fatal signal 11 (SIGSEGV) at 0x4d858000 (code=2), thread 16201 (pool-1-thread-1)

High res photo from low res stream

Hi - not really an issue, but more a question.

Is it possible to get a video stream from usb camera in for instance 640x480, and then get a single individual frame in higher resolution (1920x1080) when requested by user? IE. to take a photo in high res from a lower res video stream?

thanks,
Peter

Pause recording

Hi,

Is there any possibilities, to pause and restart record? (basically to append one video record to another video file)

Peter

Not disabling autofocus

Hi

I had tried to disable the autofocus by calling the Function setAutoFocus. I have passed false as parameter. But the camera is still getting focused automatically. How do I turn off the autofocus and How do I focus manually.

USBCameraTest3 just can display the first frame

Hi, i tried the test0/1/2 is ok, but the test3 just can display the first frame,when i touch the record button, the app isn't responding(ANR).

logcat:

01-01 03:06:39.075 30965-30965/com.serenegiant.usbcameratest3 D/dalvikvm: Late-enabling CheckJNI
01-01 03:06:39.105 30965-30965/com.serenegiant.usbcameratest3 V/MainActivity: onCreate:
01-01 03:06:39.215 30965-30965/com.serenegiant.usbcameratest3 V/CameraThread: getHandler:
01-01 03:06:39.215 30965-30965/com.serenegiant.usbcameratest3 V/MainActivity: onResume:
01-01 03:06:39.215 30965-30965/com.serenegiant.usbcameratest3 V/UVCCameraTextureView: onResume:
01-01 03:06:39.465 30965-30965/com.serenegiant.usbcameratest3 D/libEGL: loaded /system/lib/egl/libEGL_mali.so
01-01 03:06:39.465 30965-30965/com.serenegiant.usbcameratest3 D/libEGL: loaded /system/lib/egl/libGLESv1_CM_mali.so
01-01 03:06:39.470 30965-30965/com.serenegiant.usbcameratest3 D/libEGL: loaded /system/lib/egl/libGLESv2_mali.so
01-01 03:06:39.475 30965-30965/com.serenegiant.usbcameratest3 W/linker: libion.so has text relocations. This is wasting memory and is a security risk. Please fix.
01-01 03:06:39.525 30965-30965/com.serenegiant.usbcameratest3 D/OpenGLRenderer: Enabling debug mode 0
01-01 03:06:39.545 30965-30965/com.serenegiant.usbcameratest3 V/UVCCameraTextureView: onSurfaceTextureAvailable:android.graphics.SurfaceTexture@41b81f20
01-01 03:06:39.545 30965-30965/com.serenegiant.usbcameratest3 V/UVCCameraTextureView: RenderThread#getHandler:
01-01 03:06:39.545 30965-30998/com.serenegiant.usbcameratest3 D/UVCCameraTextureView: RenderThread started
01-01 03:06:39.545 30965-30998/com.serenegiant.usbcameratest3 V/UVCCameraTextureView: RenderThread#init:
01-01 03:06:39.545 30965-30998/com.serenegiant.usbcameratest3 V/EGLBase: EGLBase:
01-01 03:06:39.545 30965-30998/com.serenegiant.usbcameratest3 V/EGLBase: init:
01-01 03:06:39.545 30965-30998/com.serenegiant.usbcameratest3 D/EGLBase: EGLContext created, client version 2
01-01 03:06:39.545 30965-30998/com.serenegiant.usbcameratest3 V/EGLBase: makeDefault:
01-01 03:06:39.545 30965-30998/com.serenegiant.usbcameratest3 V/EGLBase: createFromSurface:
01-01 03:06:39.545 30965-30998/com.serenegiant.usbcameratest3 V/EGLBase: EglSurface:
01-01 03:06:39.545 30965-30998/com.serenegiant.usbcameratest3 V/EGLBase: createWindowSurface:nativeWindow=android.graphics.SurfaceTexture@41b81f20
01-01 03:06:39.565 30965-30998/com.serenegiant.usbcameratest3 V/GLDrawer2D: loadShader:
01-01 03:06:47.175 30965-30965/com.serenegiant.usbcameratest3 V/MainActivity: onConnect:
01-01 03:06:47.175 30965-30965/com.serenegiant.usbcameratest3 V/UVCCameraTextureView: getPreviewTexture:
01-01 03:06:47.180 30965-30990/com.serenegiant.usbcameratest3 V/CameraThread: handleOpen:
01-01 03:06:47.180 30965-30990/com.serenegiant.usbcameratest3 V/CameraThread: handleClose:
01-01 03:06:47.180 30965-30990/com.serenegiant.usbcameratest3 V/CameraThread: handleStopRecording:mMuxer=null
01-01 03:06:47.180 30965-30998/com.serenegiant.usbcameratest3 I/UVCCameraTextureView: RenderThread#updatePreviewSurface:
01-01 03:06:47.180 30965-30998/com.serenegiant.usbcameratest3 V/GLDrawer2D: initTex:
01-01 03:06:47.180 30965-30998/com.serenegiant.usbcameratest3 V/UVCCameraTextureView: getPreviewSurface:tex_id=1
01-01 03:06:47.180 30965-30990/com.serenegiant.usbcameratest3 D/dalvikvm: Trying to load lib /data/app-lib/com.serenegiant.usbcameratest3-1/libusb100.so 0x41b4cd18
01-01 03:06:47.180 30965-30990/com.serenegiant.usbcameratest3 D/dalvikvm: Added shared lib /data/app-lib/com.serenegiant.usbcameratest3-1/libusb100.so 0x41b4cd18
01-01 03:06:47.180 30965-30990/com.serenegiant.usbcameratest3 D/dalvikvm: No JNI_OnLoad found in /data/app-lib/com.serenegiant.usbcameratest3-1/libusb100.so 0x41b4cd18, skipping init
01-01 03:06:47.180 30965-30990/com.serenegiant.usbcameratest3 D/dalvikvm: Trying to load lib /data/app-lib/com.serenegiant.usbcameratest3-1/libuvc.so 0x41b4cd18
01-01 03:06:47.180 30965-30990/com.serenegiant.usbcameratest3 D/dalvikvm: Added shared lib /data/app-lib/com.serenegiant.usbcameratest3-1/libuvc.so 0x41b4cd18
01-01 03:06:47.185 30965-30990/com.serenegiant.usbcameratest3 D/dalvikvm: No JNI_OnLoad found in /data/app-lib/com.serenegiant.usbcameratest3-1/libuvc.so 0x41b4cd18, skipping init
01-01 03:06:47.185 30965-30990/com.serenegiant.usbcameratest3 D/dalvikvm: Trying to load lib /data/app-lib/com.serenegiant.usbcameratest3-1/libUVCCamera.so 0x41b4cd18
01-01 03:06:47.185 30965-30990/com.serenegiant.usbcameratest3 D/dalvikvm: Added shared lib /data/app-lib/com.serenegiant.usbcameratest3-1/libUVCCamera.so 0x41b4cd18
01-01 03:06:47.190 30965-30990/com.serenegiant.usbcameratest3 I/MainActivity: supportedSize:{"formats":[{"index":1,"type":4,"default":1,"size":["640x480","160x120","176x144","320x176","320x240","352x288","432x240","544x288","640x360","752x416","800x448","800x600","864x480","960x544","960x720","1024x576","1184x656","1280x720","1280x960"]},{"index":2,"type":6,"default":1,"size":["640x480","160x120","176x144","320x176","320x240","352x288","432x240","544x288","640x360","752x416","800x448","800x600","864x480","960x544","960x720","1024x576","1184x656","1280x720","1280x960"]}]}
01-01 03:06:47.190 30965-30990/com.serenegiant.usbcameratest3 V/CameraThread: handleStartPreview:
01-01 03:06:47.255 30965-31130/com.serenegiant.usbcameratest3 I/libUVCCamera: [31130_UVCPreview.cpp:492:prepare_preview]:frameSize=(640,480)@Mjpeg
01-01 03:06:47.265 30965-31132/com.serenegiant.usbcameratest3 I/libUVCCamera: [31132_UVCPreview.cpp:258:callbackPixelFormatChanged]:PIXEL_FORMAT_RAW:
01-01 03:06:49.805 30965-31131/com.serenegiant.usbcameratest3 W/libUVCCamera: [31131_UVCPreview.cpp:119:get_frame]:allocate new frame
01-01 03:06:49.805 30965-31130/com.serenegiant.usbcameratest3 W/libUVCCamera: [31130_UVCPreview.cpp:119:get_frame]:allocate new frame
01-01 03:06:49.890 30965-31131/com.serenegiant.usbcameratest3 W/libUVCCamera: [31131*UVCPreview.cpp:119:get_frame]:allocate new frame

Dual camera recorder

Hi, i want to implement a dual camera recorder. I duplicated every class (in encoder, widget packages - with every innerclasses), but unfortunately, i always have only 1 recorded video, the other file (randomly from camera1 or camera2) is always an empty mp4 (that players cannot play).

usbCameraTest5 sometimes could display view but sometimes could not.

Hi,
Thanks for your efforts.
I ran usbCameraTest5 successfully on my phone, and clicked toggle button to open camera. Then I selected my camera in " Select USB Web Camera " Dialog. However the view was still black.(toggle button was on, and capture button was visible)
Soon I found that onConnect()had been called but onAttach() not.
After a while, I ran again, and picture was in screen! I could also capture the frame!
Unfortunately when I tried again the view turned black again.
I tested several times, sometimes it could display view but sometimes not. And most were failed.
Any help would be appreciated!
Thanks~

Multiple cameras: first Camera crashes when requesting permission for the second

Hi saki,
I have another problem with the library when used with multiple cameras and previews. If I connect one camera and start the preview, then connect a second camera and try to start the preview the first preview stops when the dialog with the USB request shows up.
The only way to get two cameras working is to start the preview for the first, then stop it, then start the preview for the second and start the preview for the first again (this time the permission was already requested and the second camera preview continues).
I guess this is a problem with your USBMonitor implementation.

AppRTC

How can I stream video using this library to werbRTC for android, I am able to run both AppRTC and UVCCamera examples successfully but i am not sure how to stream from UVCCamera library to AppRTC
-venkat

How do I quit dialog to usb permission?

Hi, Saki.

I want to connect to USB Camera from app android without request permission to communicate with the device. is it possible?

Thank for attention.

Detects camera but doesn't display cameraview

Hello, Thank you for great source. You are a life-saver (:
I tried to run examples in 2 different devices, both of them detects uvc-camera, however one of them does not return view. Do you have any idea, how to fix this?
Thank you

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.