Android camera2video integrated into its own project

Time:2020-10-21

Background: in the Android project, the camera is called to shoot video MediaStore.ACTION_ VIDEO_ Capture was later changed to Camera2 due to the needs of the project

1. There is something wrong with camera2video’s official demo. After downloading, it can’t be directly integrated into the project

Problem 1. Multiple video crashes

Question 2. Double click the record button to report an error

The first problem is that if you just shoot a video, you can finish it directly. You don’t need to shoot it many times, so it doesn’t affect you. However, we still find a solution on the Internet

The second problem is to double-click the view to monitor. When you double-click, it doesn’t respond directly. When you shoot a video, you can click to shoot and then click to finish, or click one to start shooting until the countdown is over

The UI of camera2video’s official demo page is a little crude, so we used the control circleprogressbar of cameravideo’s official demo to change the original button to ImageView,

The official cameravideo demo has a better click effect, but the compatibility of this demo is not very good,

 

Two demos are all right

Camera2Video demo :

https://github.com/googlearchive/android-Camera2Video

CameraVideo demo :

https://github.com/xiaoxiaoqingyi/android-CameraVideo

Among them, camera2video is downloaded and zip. When running, some file resources cannot be found. It is the screenshots folder, and two pictures are not downloaded settings.gradle There are no files. There are these resources on GitHub, but they are not in the download zip. I don’t know if it is the reason of my network