Front facing Camera Recorded video not proper - android

I want to record Video using front facing camera. Using the example from here as reference. I changed the getCamerainstance method to getFrontFacingCamera. I am able to see the preview while recording. But when i close the recording and play the video, it is always some horizontal flickering lines. Seems like some encoding issue. I tried- changing the media recorder profile to QUALITY_LOW/ QUALITY_HIGH, - Setting the frame rate to 15. the same app works perfectly when i use rear camera.
P.S: I have set the preview's(surface view's) size to 208×208. (Should this affect? , It's working fine with rear camera).
Thanks

Finally solved it. (In case someone faces the same issue)
need to use: mediaRecorder.setVideoSize(320,240);

Related

Background video recorder with wrong camera orientation

I used code from here. But there is one problem, I can´t change camera orientation. Final video is upside down.
I tried to change it by this (I tried all possible values - 0,90,180,270):
camera.setDisplayOrientation(90);
camera.getParameters().setRotation(90);
or
camera.getParameters().set("orientation", "portrait");
camera.getParameters().set("rotation", 90);
But nothing works. Any idea how to setup it?
I tested it on Nexus 5X with Android 7.1.1.
I want to use fixed orientation, no matter how I hold device, orientation must remain same.
camera.setDisplayOrientation(90) This affects the preview frames and the picture displayed after snapshot. This does not affect the order of byte array passed in onPreviewFrame, JPEG pictures, or recorded videos. So you can't change the REC orientation using this API. If you want to change the REC orientation, you should rotate the every frame date in onPreviewFrame or rotate the SurfaceTexture base on the way you record video.
use mediaRecorder.setOrientationHint(180);

Distorted images when using GLSurfaceView for camera preview

I've got the problem, that when I try to use a GLSurfaceView to display the camera preview, the preview image ends up being totally distorted, but only if I choose a preview size of >= 1280x720. At lower resolutions (e.g. 960x720) everything is fine. Here is what the preview image looks like:
I noticed this while I was trying to record a video stream from the camera, which works fine appart from the distorted images. So I tried to just show the camera preview using this code -> http://maninara.blogspot.co.at/2012/09/render-camera-preview-using-opengl-es.html
I noticed that as soon as the width gets larger than 1000px, the image ends up distorted, and also tried to use another image format, but that didn't help either. I'm running this on a Google Glass API 19.
Kindest regards,
Wolfram

Rotate and append videos with mp4parser

I would like to append several video files from the camera through mp4parser.
Unfortunately, in the same fragment, despite the fact that I try to change the OrientationHint of the media recorder when changing camera, only the first one seems to work (ie. if I start with the front camera, the videos with the back camera are reversed and vice versa).
To solve this problem, I tried to rotate the video that are in the wrong direction and that works (with the method of setMatrix mp4parser, the new files are in good direction). But when I want to append the files, (all in the right direction) I get the same result as if I had not rotated the videos, as if it could have only one orientation videos for my final component video.
Do you have a solution for this?
Thanks

Android - Distorted Camera Preview

I am currently writing an android app which runs displays a circle drawable on the preview frame, runs edge detection and then takes a photo once the user lines up a coin perfectly in the circle.
For some reason (despite being fullscreen with no title etc.), I am started to realize the camera preview is every so slightly distorted.
I have tried setting the previewsize to 480x640 while also setting the surfaceholder size to 480x640, however if I save the preview to bitmap and also take a photo, you can notice the distortion.
Has anybody else had this kind of problem / or have any ideas as to a solution?
I have encountered the same issue.
Hopefully I found that ApiDemos includes a working example with Camera.
You can find it here: com.example.android.apis.graphics.CameraPreview.
I didn't digged the example, but I saw it's working fine just as my real camera, no distortion at all.

How can I show a preview picture after taking a video using MediaRecorder?

I am using MediaRecorder and a SurfaceView to create a custom video camera app. After the user has clicked a stop button, I'd like to show the user a preview of the video (maybe the first or last frame). Is there an easy way to do this?
Thanks!
for future references. It's possible to use the
surfaceHolder.getSurface().freeze();
to hold the last frame.

Categories

Resources