EXTRA_VIDEO_QUALITY is ignored

android

Solution

Check out the documentation for MediaStore.EXTRA_VIDEO_QUALITY

It says that value 0 means low quality. You could change your value to 1.

And the value for 5Mb I would set to 5491520L.

All together could be:

import android.provider.MediaStore;
...


Intent i = new Intent(MediaStore.VIDEO_CAPTURE);
...
i.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
i.putExtra(MediaStore.EXTRA_SIZE_LIMIT, 5491520L);//5*1048*1048=5MB
i.putExtra(MediaStore.EXTRA_DURATION_LIMIT,45);
startActivityForResult(i, Config.RECORD_VIDEO);

Problem

I am trying to record a video with an Intent, and the quality of the video is high and the size is higher than 5mb. I am using Samsung Galaxy S running android 4.2.2 Here is my code: ``` Intent i = new Intent("android.media.action.VIDEO_CAPTURE"); // i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, // Uri.fromFile(FileUtils.getFileName(FileTypes.VIDEO))); i.putExtra(android.provider.MediaStore.EXTRA_VIDEO_QUALITY, 0); i.putExtra(android.provider.MediaStore.EXTRA_SIZE_LIMIT, 5242880); i.putExtra("android.intent.extra.durationLimit", 45); startActivityForResult(i, Config.RECORD_VIDEO); ```

Original source