Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select video from gallery and crop/resize it just like image cropping in android

How to select video from gallery and crop/resize it just like image cropping in android. I am searching it for last two days. But i didnt find any samples or example. If you have any idea or samples, pls suggest me.

Thank You.

like image 510
ramkumar5035 Avatar asked Oct 04 '13 06:10

ramkumar5035


People also ask

How do I crop or resize a video?

Step 1: Open the video you wish to crop and click on the Edit option. Step 2: Click on the Crop Button. Step 3: Click on the “Aspect Ratio” button on the right top corner of your screen. Step 4: Select the aspect ratio you wish to crop your video to.


1 Answers

On android 4.0 + you can use TextureView

Basic idea is to use Matrix object.

Matrix matrix = new Matrix();
matrix.setScale(scaleX, scaleY, pivotPointX, pivotPointY);
mTextureView.setTransform(matrix);

Full article available here.

like image 107
Dmytro Danylyk Avatar answered Oct 13 '22 09:10

Dmytro Danylyk