**Main Question:** How can I capture video without preview using Camera2 API?

I am trying to record video from a Background Service without showing any preview. 

Here is the same [question](https://stackoverflow.com/questions/10121660/how-to-record-video-from-background-of-application-android) asked but I want to do it with Camera2 API.

I found a sample code in [Camera2VideoJava](https://github.com/android/camera-samples/tree/master/Camera2VideoJava) and trying to use that in the service. 

I am unable to understand what to do now because there is no documentation to do something like this.

Can anyone please help?