How to reduce size / quality of video file Android - android

I have been looking for solution here and google but I didn't find it.
I want to reduce video file from camera or gallery to send it to server.
please help me

Related

Efficeint video compress for android

What is the simple way to compress android cam recorded video as well as gallery video? I did not any sufficient solution till now.

How to restrict captured video size(20MB to 30MB) in titanium?

I have a requirement that need to take video and upload to server. In server we have upload limit as 20MB to 30MB so my video size should not exceed that limit.
Is that possible to handle video size or video seconds 60 to 120 seconds. It should work in all type of devices like ipad,iPhone6 and iphone6plus same like android higher resolution devices too.
Whats the best approach to handle this requirement.
1) Video size restriction.
2) Video capturing seconds restriction.
3) Video edit cropping video to match the size.
Please suggest me any idea or approach.
There is the videoMaximumDuration property on the CameraOptionsType Object.
Ti.Media.showCamera({
videoMaximumDuration: 20
});
Restricting by the video filesize is not possible when capturing. You would have to set the videoMaximumDuration dynamically according to the capturing device - but thats not accurate.
If you just want to bypass the upload restriction you could chunk the upload of the videofile like so: http://lowb1rd.github.io/002-chunked-uploads-with-titanium.html

Compress video without using ffmpeg in android

I looking for any SDK-LEVEL(without using ffmpeg) approach for compress video programmatically in android.
I can't use ffmpeg cause its size overhead.Is there any lightweight solution for that ?
I want reduce size of video before uploaded to server (i can't modify server upload limit) so if you have any idea other than compressing video please share it.
note : my min-sdk version is 14

compress video file before uploading to server

I am trying to upload the video file to server , for small size video like 4 to 5 mb it works fine , but if when i am trying to upload the video more than 15 to 20 mb , it takes too much time for upload , that's why i want to compress the video , is there any library or tool available for compressing video before uploading to server.
thanks.
There are few approaches that you can take to upload larger size video on to the server:
1) You can make use of standard way of recording it across all mobiles which give you standard size:
mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
mediaRecorder.setVideoEncodingBitRate(690000 );
2) Make use of ffmpeg or work around with it, it might help to compress video.
https://github.com/halfninja/android-ffmpeg-x264
3) (Recommended) Compressing the video according to me will degrade the quality of video to far worse stage, so what the other work around and best which majorly used is:
Make a Byte array of the video
Make small Chunks of that byte array
Make a Web-service on Server reads this Chunk one by one, send it in queue.
Once received on server make a Video file out of it again.
Runs this Operation in Background async or as service anyways. So it doesnt effect foreground process. Once its done Just Notify!!
Hope this will help
You can try use the FFMpeg library.
It's easy way to compress videos.
Can you check the site https://www.ffmpeg.org/ for more information, or post as comment what are you need to compress.
If you change CRF with the command -crf "15~25". It's a good compress video with good quality.

Is there possibility to compress audio and video file in android programmatically?

As I record the video file for 1min it take 3mb of size as i want to post this file to server it is taking more time.So I need to decrease the time by compassing the recorded video file and send it to server.Is there possibility to compress the video file programmatically.
Thanks in advance.
Teja.
Note that simply compressing it with some zip-algorithm (relatively easy to do in Java) wouldn't help you much. Try compressing the file yourself. (If it did make the file smaller, it would most likely already be a part of the video-file format, wouldn't it :-)
If you want to compress the video, you have to re-encode it with a lower bit-rate / lower resolution or something similar.

Categories

Resources