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.