natario1 / CameraView

📸 A well documented, high-level Android interface that makes capturing pictures and videos easy, addressing all of the common issues and needs. Real-time filters, gestures, watermarks, frame processing, RAW, output of any size.
https://natario1.github.io/CameraView
Other
4.96k stars 939 forks source link

How to get mime type and extension of taken videos and pictures? #1225

Open waterdrake opened 1 year ago

waterdrake commented 1 year ago

Is there a way to get the the mime type and extension of a taken video? I can get the file but it does not seem to have an extension or mime type:

            @Override
            public void onVideoTaken(@NonNull VideoResult result) {
                File file = result.getFile();
            }

Also, on that note, is there a way to get the mime type and extension of a taken picture?


            @Override
            public void onPictureTaken(PictureResult result) {
            }
EzequielAdrianM commented 1 year ago

When you configure the camera settings, you can tell the Camera API what resolution, format, and compression to use, so you should already know it.

waterdrake commented 1 year ago

@EzequielAdrianM Can you point me to where I can learn about how to configure those camera settings you mentioned?