Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?

Or, is there a way to reduce the resolution later.

We need to reduce the file size of the video that we capture.

Thanks

Shani

like image 945
shannoga Avatar asked Jun 27 '12 13:06

shannoga


People also ask

How do I change the resolution of a video on Android?

Tap on the three dots at the top right corner. Select the settings icon. Enable Alternative Resolution. Reduce video resolution to Bitrate. And that's it! I’m assuming that you want to maintain the same resolution and keep the quality as same as possible. On that note - a little background info first (as always)….you can skip it if you want.

What is the resolution of video?

Video resolution is expressed as width x height of a video in pixels. Standard Definition (SD), High Definition (HD) and 4K (UHD) are 3 types of common video resolutions. To play the video on different devices or players, you need to change video resolution to get the smooth playback.

Why do I need to increase the video resolution?

For example, when you upload videos from a computer to your smartphone or mobile devices, the video resolution needs to decrease because these devices may support specific resolutions only. While in some cases, you may need to increase the video resolution, for example, cons My mobile video is 10 minutes long and 700 MB in size.

How big is a 1 minute video file on Android?

Video resolution and corresponding file sizes on Android Short Name Name on Device Video Resolution File Size (1 minute) Ultra HD or 4K 3840 x 2160p 3840 x 2160 320 MB Full HD 1920 x 1080 / 1080p 1920 x 1080 149MB HD 1280 x 720 / 720p 1280 x 720 105 MB WVGA / (Wide SD) 720 x 480 / WVGA 720 x 480 26 MB


1 Answers

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.

like image 197
Aleks G Avatar answered Nov 30 '22 09:11

Aleks G