I am writing an app where I am allowing the user to capture video using the phones camera. I am using my own code to record the video as opposed to Androids built in camera app.
Everything is working OK except I need to be able to access the list of supported camera resolutions so I can choose at runtime which one to use. I am looking for something like getSupportedPictureSizes()
but for video. Android 3.0 has this functionality but I am looking for something for 2.2.
As of right now I am using CamcorderProfile.QUALITY_HIGH / QUALITY_LOW
, but this only gives me two options and on the phones I have been testing on, the file sizes are at each extreme.(QUALITY_LOW is 216 kb/s and QUALITY_HIGH is > 3 MB/s)
Any help would be greatly appreciated, Thank You!
Did you try to use the getSupportedVideoSizes()
method from Camera.Parameters
class?
public List<Camera.Size> getSupportedVideoSizes()
This method returns a list of Size objects. It will return null
if the camera does not have separate preview and video output. The answer here indicates that when this returns null
you may use the getSupportedPreviewSizes()
list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With