0

I'm recording video and simultaneously want to draw something on camera preview such that recorded video will record activities done on camera preview(draw). I searched lot about this didn't find any proper solution.I also want to do following work

  1. Face detection and apply some change on that like change hair colour.

  2. change preview background custom

  3. brightness and contrast on camera preview.

Willi Mentzel
  • 27,862
  • 20
  • 113
  • 121
Dilip
  • 2,271
  • 5
  • 32
  • 52

1 Answers1

0

Unfortunately, the answer by Raghav Sood don't resolve your problem. That's because the camera preview (via SurfaceView) cannot be synchronized with your image processing, which probably relies on onPreviewFrame() callbacks.

To achieve the desired effect, you must hide the preview (probably, using the SurfaceTexture instead of SurfaceView), and display the preview images (as received in onPreviewFrame()), with the corresponding overlays, or maybe modify the image and display the result, in your own view. For best results, you will probably use OpenGL.

Community
  • 1
  • 1
Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
  • Thanks @Alex Can u please elaborate how to do this? – Dilip Dec 28 '13 at 05:26
  • One example is provided here: http://stackoverflow.com/questions/19216893/android-camera-asynctask-with-preview-callback; an OpenGL example can be found here: http://stackoverflow.com/questions/12519235/modifying-camera-output-using-surfacetexture-and-opengl – Alex Cohn Dec 28 '13 at 07:30