Getting frames from Video Image in Android

Ok what we ended up doing is using the onPreviewFrame method and decoding the data in a seperate Thread using a method which can be found in the android help group. decodeYUV(argb8888, data, camSize.width, camSize.height); Bitmap bitmap = Bitmap.createBitmap(argb8888, camSize.width, camSize.height, Config.ARGB_8888); … // decode Y, U, and V values on the YUV 420 buffer … Read more

iPhone AVFoundation camera orientation

Well, it’s taken me fracking forever but I’ve done it! The bit of code I was looking for is [UIDevice currentDevice].orientation; This goes in as so AVCaptureConnection *videoConnection = [CameraVC connectionWithMediaType:AVMediaTypeVideo fromConnections:[imageCaptureOutput connections]]; if ([videoConnection isVideoOrientationSupported]) { [videoConnection setVideoOrientation:[UIDevice currentDevice].orientation]; } And it works perfectly 😀 Woop woop!

Can I change the LED intensity of an Android device?

HTC has an alternative API that supports this, however it’s only on HTC Sense devices, and as of Gingerbread they’ve changed the permissions so it’s only for their Flashlight app, not third party ones (unless you use root). But on 2.2 HTC devices you can use it by writing a string to /sys/devices/platform/flashlight.0/leds/flashlight/brightness. This controls … Read more

XNA 2D Camera Engine That Follows Sprite

So I figured it out using a combination of the tutorials above and have created the class below. It tweens towards your target and follows it around. Try it out. public interface IFocusable { Vector2 Position { get; } } public interface ICamera2D { /// <summary> /// Gets or sets the position of the camera … Read more

UIImagePickerController – How do I access the front facing camera by default?

UIImagePickerControllerCameraDeviceFront is not a valid enum for the sourceType property. The sourceType property defines whether you’re using the camera or the photo library. You need to set the cameraDevice property instead. Objective-C self.imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera; self.imgPicker.cameraDevice = UIImagePickerControllerCameraDeviceFront; Swift 2 imgPicker.sourceType = .Camera imgPicker.cameraDevice = .Front Swift 3 imgPicker.sourceType = .camera imgPicker.cameraDevice = .front

Android: Overlay on Android Camera Preview

You can use SurfaceView and create a CustomView that will open the camera and you can adjust its size in the xml accordingly. Below is a pseudo code. Create a class that extends SurfaceView and open camera inside that CapturePreview.java public class CapturePreview extends SurfaceView implements SurfaceHolder.Callback{ public static Bitmap mBitmap; SurfaceHolder holder; static Camera … Read more

Android: Switch camera when button clicked

Button otherCamera = (Button) findViewById(R.id.OtherCamera); otherCamera.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (inPreview) { camera.stopPreview(); } //NB: if you don’t release the current camera before switching, you app will crash camera.release(); //swap the id of the camera to be used if(currentCameraId == Camera.CameraInfo.CAMERA_FACING_BACK){ currentCameraId = Camera.CameraInfo.CAMERA_FACING_FRONT; } else { currentCameraId = Camera.CameraInfo.CAMERA_FACING_BACK; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)