How to compress a video file in Android before uploading to a remote server? I am not going to write the file because I do not think this will help. I want to compress a video and transcode it with a lower data rate or resolution. The idea is to get a standard 360x480, 30 FPS video file from each device. In this way, I can avoid the fact that users with better cameras will be forced to upload huge video files.
I know that iOS makes formatting video files easier. 10 second video recorded on iPhone 4:
- high (1280x720) = ~ 14 MB = ~ 11 Mbps
- 640 (640x480) = ~ 4 MB = ~ 3.2 Mbps
- medium (360x480) = ~ 1MB = ~ 820 Kbps
- low (144x192) = ~ 208 KB = ~ 170 Kbps
Is there an easy way to do this in Android? Do I need to find an external library that will allow me to transcode the video file and then save it to the SD card (or overwrite the old video file) and then upload this file? Mostly looking for a general direction here, not code for copy and paste, although something is useful.
source share