How to programmatically take Photos while recording Video using Camera2 API in Android

前端 未结 6 1753
北恋
北恋 2020-12-24 09:41

I want to capture image while recording video using camera2 API.

Two separate demos are available. 1. To capture image and 2. To record video

I tried to com

6条回答
  •  生来不讨喜
    2020-12-24 10:01

    Create a video thumbnail for a video. May return null if the video is corrupt or the format is not supported.

    private void makeVideoPreview() {
        Bitmap thumbnail = ThumbnailUtils.createVideoThumbnail(videoAbsolutePath, MediaStore.Images.Thumbnails.MINI_KIND);
        saveImage(thumbnail);
    }
    

提交回复
热议问题