2

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.

WebDiva
  • 133
  • 3
  • 23
  • I do not know about MediaCodec, but there are a video library called open CV, you find it C++, Python, C# and Java (https://opencv-java-tutorials.readthedocs.io/en/latest/) you can you use it to control camera and record from one or multiple cameras. I have not done it with Java but found a python example https://stackoverflow.com/questions/29664399/capturing-video-from-two-cameras-in-opencv-at-once that you can get inspiration from to your Java code. – Maytham Fahmi Nov 02 '20 at 14:52
  • Thank you. Will definitely check on that! – WebDiva Nov 02 '20 at 15:33

1 Answers1

1

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.

Tobi
  • 41
  • 1
  • 4