Astyan
Astyan

Reputation: 324

recording video from a service with Camera2 API

I have issues on some phones that I can't test on (that's the first problem) I'm trying to build a service that can record from camera2 API. But when I send the app to the background, on some phone it appears to have issues that I am failing to solve at the moment. I only have logs and cannot figure out the main reason for the app not working.

Thank you for helping

Edit:

You'll find the actual source code that solved my problem here: https://bitbucket.org/dreamappsfr/kinghul

This was a POC that has been stopped. I honestly don't remember how I overcome this specifical issue at that time.

Upvotes: 12

Views: 3017

Answers (1)

Benjamin RD
Benjamin RD

Reputation: 12034

You would try with:

Camera2-Video

Basically it is a wrapper for the video capture using Camera2.

Add you your build.gradle file:

compile 'com.wesleyelliott:camera2-video:0.0.2'

and create a Fragment extended from com.wesley.camera2.fragment.Camera2Fragment and override the methods getTextureResource and getVideoFile.

To start recording, you must use the method: startRecordingVideo(), to stop it stopRecordingVideo and to check if the app is currently recording a video or not, a method isRecording().

I already used it and is the simpler way to record a video with Camera2

Upvotes: 2

Related Questions