How to record and save video with camera2 and mediacodec api?

Viewed 278

I am trying to make a camera application and am currently trying to record video. I tried MediaRecorder but it does not meet my needs as I need to do some video editing and I noticed that MediaRecorder skips some frames before recording. I searched everywhere looking for a proper tutorial but there is none. How to achieve this? How can I create and save video using MediaCodec with Camera2 API? I don't need the full Java code on how to implement the camera but just a brief code which shows which camera2 parameters should be passed to the MediaCodec. The MediaCodec implementation and the way to save video is all what I want. Hope you will answer. Thank You.

1 Answers

When you want to create your application with Java, you could try JavaCV. It's a Wrapper for OpenCV and many more libraries written in Java.

There you could use the cv2.Videocapture method.

Related