How to compress video to the maximum level of android

I am working on an Android application.

I compress the recorded sharpness of the video to send it to the server. The maximum video length is 30 seconds.

I can download video from phones that have 2 or 3 MP.

But it failed to boot from phones with 8 MP, such as Samsung S3 or S2 or grand ..

the screen continues to load (which means loading).

At any time, please help me compress the video to the maximum level.

My code is:

File mediaFile = new File(
                MediaStore.Images.Media.EXTERNAL_CONTENT_URI.getPath()
                        + "/IRCMS_video.3gp");

        Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);

        Uri videoUri = Uri.fromFile(mediaFile);

        intent.putExtra(MediaStore.EXTRA_OUTPUT, videoUri);
        intent.putExtra(MediaStore.EXTRA_SIZE_LIMIT,41943040);
        intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT,30);
        intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);

        startActivityForResult(intent, 3);
+1
source share

Source: https://habr.com/ru/post/1545354/


All Articles