Reputation: 1645
Code set resolution:
private void setResolutionCamera(int G) {
Camera.Parameters cp = mCamera.getParameters();
List<Size> sl = cp.getSupportedPictureSizes();
int w = 0, h = 0;
boolean exist = false;
int i = 0;
for (Size s : sl) {
// if s.width meets whatever criteria you want set it to your w
// and s.height meets whatever criteria you want for your h
i++;
if (i == G) {
w = s.width;
h = s.height;
exist = true;
break;
}
}
if (!exist) {
for (Size s : sl) {
w = s.width;
h = s.height;
break;
}
}
cp.setPictureSize(w, h);
mCamera.setParameters(cp);
}
I set size: 2560x1920, but video result still is 640x480 . Why video can't changed resolution in camera app android 2.3?
Upvotes: 0
Views: 81
Reputation: 75646
Shooting still images is different thing from recording videos as the latter requires more performance due to continuous stream of data needed to be processed. So you cannot just set anything and expect it to work. Basically unless your device clearly announces in specs that it is capable of doing so high resolution video recordings, you shall expect lower resolution being used.
If you targetting API11 or higher you can use getSupportedVideoSizes() to supported video frame sizes instead of calling getSupportedPictureSizes()
which is for stills.
Upvotes: 1