简体   繁体   中英

How to set custom resolution for screen recording using media recorder in android programmatically?

I am actually implementing screen recording in android devices. I want my videos to be recorded in custom resolution before recording like 360p, 480p, 720p. I've tried to set height and width in mediaRecorder.setVideoSize(width*height) but it only changes the size of screen recording.

You should use CamcorderProfile and hasProfile() to see what profiles are supported on the device, and choose from those.

See the documentation here for the list of defined resolutions:

https://developer.android.com/reference/android/media/CamcorderProfile

Here is another guide which may help as well:

https://medium.com/jamesob-com/recording-your-android-screen-7e0e75aae260

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM