Android Camera: rotating output videos - android

I have a problem with output video for MediaRecorder - it rotates videos at 180 degrees after front face camera recording, but playback rotation during recording is normal. You see, native camcorder for my device (Samsung Vibrant) has the same result for front face camera. My app supports Froyo (2.2) and higher, thats why I can't try setOrientationHint() to rotate output. Any solutions?
Thanks!

Related

Video encoded using camera2 is upside down on nexus (5x, 6p) devices

We are using camera2 API to get preview and encode video simultaneously, using mediacodec.
We know when we should rotate the camera by querying 'CameraCharacteristics.SENSOR_ORIENTATION' but there is only preview rotation option.
What we need is to rotate the surface which goes to the encoder so we will not get video upside down. (Or rotate the camera itself like the old camera API.)
Thanks

how to prevent video playing in landscape mode in android device?

I am working as a android developer and while testing my app in Samsung I found something.
When I am capturing any video in my Samsung device with portrait mode, and then playing it in a video view, it will display with the wrong orientation. Portrait video will play with landscape orientation. I think it is rotating the video 90 degree left. Please guide us to solve this problem.
Video is played in the correct orientation in devices from other manufactures like Google Nexus or Micromax. It is played in the correct orientation but in Samsung the portrait video orientation is not proper.

Samsung Galaxy S4 front camera glitch when CameraProfile changed

I have an issue with video recording on S4.
What I need is front facing recording with good quality/size ratio. What I do is set CameraProfile to QUALITY_480P and that is basically all (video size is about 3MB). Everything is working except on S4 which works only on QUALITY_HIGH (not even on QUALITY_LOW). What more same video length has over 50MB on high.
Preview on S4 is OK, but recorded video looks like the image below. All I do is basically this (I use cwac, but this is my debug code):
CamcorderProfile profile = CamcorderProfile.get(cameraId,
CamcorderProfile.QUALITY_HIGH);
recorder.setProfile(profile);
Any way to fix this please?
OK so I found that this happens when you try to record with front facing camera in portrait mode. What really messes up encoded video is recorder.setOrientationHint(). This line is kind of needed, without it the recorded video is 90 degrees rotated.
That means one issue is fixed. Now I need to how to rotate recoded video.

Corrupted preview frame in 720p on Google Glass

I'm using Google Glass to stream video, and need to grab the camera frames. I'm using the OnPreviewFrame() callback to get it, and everything is fine with resolution up to 800x480. When trying to do the same with 720p resolution I get a corrupted frame. If I save the data to file and try to show it as 720p NV21 frame, it is completely corrupted. I played around a bit, and discovered that if I show it with 1288 width, I can recognize what of the image, but it still has some issues with it. I'm using SurfaceTexture for the preview.
The same code works fine on Nexus7.
So it turns out Glass has an issue with 720p60 preview. When I changed the frame rate to 30fps, I got perfect 720p frames
In your init preview method, did you set parameters like this?
parameters.setPreviewFpsRange(30000, 30000);
parameters.setPreviewSize(640, 360);
mCamera.setParameters(parameters);
I found with these settings, my Glass preview would look distorted.

android recording video and playing it back immediately

hi guys i have been trying to record a video with front camera and the playing it back using the videoview and mediacontroller. But facing the orientation problem, as i record the video with camera orientation set to 90 degree(PORTRAIT) but when the recorded video is played it doesnot play in PORTRAIT mode instead it plays in landscape mode. Also have tried setting the media recorder object's setOrientationHint method to 180 degree. Still with no success. Hope someone could have faced or solved this issue and hoping for better responses. Thanks in advance. If needed i can post my code snippets too.
rotate videoview to 90 degree.

Categories

Resources