Skip to content

Instantly share code, notes, and snippets.

@owahltinez
Created October 11, 2018 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owahltinez/f615e13bfc3497a0bd5d1427eae6c54f to your computer and use it in GitHub Desktop.
Save owahltinez/f615e13bfc3497a0bd5d1427eae6c54f to your computer and use it in GitHub Desktop.
val session: CameraCaptureSession = ... // from CameraCaptureSession.StateCallback
// We will be using the preview capture template for the combined streams, because
// it is optimized for low latency; for high-quality images use
// TEMPLATE_STILL_CAPTURE and for a steady frame rate use
// TEMPLATE_RECORD
val requestTemplate = CameraDevice.TEMPLATE_PREVIEW
val combinedRequest = session.device.createCaptureRequest(requestTemplate)
// Link the Surface targets with the combined request
combinedRequest.addTarget(previewSurface)
combinedRequest.addTarget(imReaderSurface)
// In our simple case the SurfaceView gets updated automatically. ImageReader
// has its own callback that we have to listen to in order to retrieve the frames
// so there is no need to set up a callback for the capture request
session.setRepeatingRequest(combinedRequest.build(), null, null)
@shgrg1712
Copy link

shgrg1712 commented Jan 9, 2019

Hello ,
I have one requirement

  1. Create two surface view for front and back camera on one screen.
  2. Record the one video using media recorder which has both front and back camera surface view.

Is it possible to record one video from both camera together using mediarecorder.?

Please help to share java code if possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment