Android - is there a way to define the video resolution when taking video from application?

前端 未结 1 417
自闭症患者
自闭症患者 2020-12-19 12:47

I am not familiar with android programming,

I wish to know if there is a way to set the video resolution when it is filmed inside an android application ?

O

相关标签:
1条回答
  • 2020-12-19 13:35

    There are three things you can control to manage the resulting file size when recording video. All three are available as methods in MediaRecorder class:

    1. Frame size (width x height). Use method setVideoSize(int width, int height). The smaller the frame size, the smaller the video file.

    2. Encoding bit rate - this controls compression quality of each frame. Use method setVideoEncodingBitRate (int bitRate). Lower bit rate results in higher compression, which in turn leads to lower quality and lower video file size. This is only available from API level 8 and above.

    3. Video "speed" - how many frames per second are captured. Use setVideoFrameRate (int rate) method. The lower the rate, the fewer frames you'll be capturing - resulting in a smaller video file size. This is only available from API level 11 and above. Remember though that for a smooth video you need at least 24 frames per second.

    Have a look at the documentation for MediaRecorder` for more information.

    0 讨论(0)
提交回复
热议问题