0

I am developing a screen recording app that uses the mediaprojection class for lollipop. Now here is my question how do I set resolution of the recording? Let's say I want to record in 1920 x 1080 p

Do i only need to set video size to 1920, 1080?

Thanks!

YOYOYO
  • 211
  • 1
  • 2
  • 12

1 Answers1

-2

You set the resolution on the video encoder (MediaCodec or MediaRecorder), then pass the input Surface from that to the virtual display.

fadden
  • 51,356
  • 5
  • 116
  • 166
  • And how would i do that? I have tried MediaRecorder.setVideoSize but im guessing that is not correct. – YOYOYO Sep 08 '15 at 18:41
  • I haven't worked with MediaRecorder and Surfaces (it's a relatively new feature). I would hope that `setVideoSize()` would work, but it's possible that it only works correctly with input from Camera (e.g. the video size request is simply forwarded to Camera, or dropped if the input is from a Surface). Make sure you're doing things in the order shown by the docs (http://developer.android.com/reference/android/media/MediaRecorder.html#setVideoSize(int,%20int) ). If all else fails you may have to resort to MediaCodec. – fadden Sep 08 '15 at 22:34