问题
I'm trying to record the contents of the screen using mediarecorder and mediaprojection api. When I'm trying to change the video to HD on my device the recording fails but it works fine with 640 x 480 resolution. So my question is how could I get the supported video resolutions on a particular device? Cheers Jon
回答1:
If your only interest is in API 21+, you can use the getVideoCapabilities() method.
The CamcorderProfile class has been around since API 8, but isn't quite as useful.
If all else fails, use trial and error, testing each desired resolution and flagging the ones that don't work.
来源:https://stackoverflow.com/questions/33203242/supported-video-sizes-mediarecorder-api-android