Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android flip front camera mirror flipped video

Tags:

I'm trying to record a video from Android's front camera while displaying on surface view as well.

What I found out with the front camera is that it mirror flips the video during recording, even though the surface view shows a normal view.

Is there any way I can prevent this or fix it?

I read upon other stackoverflow articles like How to keep android from inverting the image from the front facing camera?

But it seems to be only talking about taking photos with the front camera and reversing the image, which I already fixed using matrix myself. However, it seems like using a matrix for a video does not work.

like image 492
Danny Kim Avatar asked Aug 27 '13 01:08

Danny Kim


1 Answers

In my case, I just need to horizontal-flip when playing it. When recording it's already flipped for mirror effect and as I see it's not possible to modify it. However below code solved my problem when playing.

videoPlayer.setScaleX(-1); 
like image 113
asozcan Avatar answered Nov 11 '22 11:11

asozcan