Reputation: 3391
I am trying to record a video on a Samsung Galaxy S2. I have used the usual calculations to figure out the best preview dimensions and this has returned 720x480 or 800x480 depending on algorithm. The full list returning from getParameters().getSupportedPreviewSizes()
looks like this:
"640x480", "720x480", "800x480", "320x240", "176x144"
Setting these previews looks fine in the beginning. It seems to be recording the video, however after stopping the camera there's no video captured.
If I get height and width values from CamcorderProfile.get(mCameraId, CamcorderProfile.QUALITY_HIGH);
and set those values for my previewsize (1920x1080) (which should not be supported as it's not in the list?), the recording works fine. This is really puzzling.
There are no errors I can see in logs, it's just not recording the video...
Upvotes: 2
Views: 1509
Reputation: 2060
getParameters().getSupportedPreviewSizes()
gives you the preview sizes for the camera, not the recording sizes, or pictures sizes.
for recording a video, there are other supported sizes as for pictures, which you could see in the docs of:
http://developer.android.com/reference/android/media/CamcorderProfile.html
to get the supported video sizes just call:
getParameters().getSupportedVideoSizes()
so you need to set both, the preview and the recording size.
how you could do this, in answered here: How to record video of particular width and height on samsung device android?
Upvotes: 1