Error Opening Android Camera For Streaming Video
I'm trying to write video stream from my Galaxy Tab to server. according to this manual i should do something like this: frontCamera = getFrontCamera(); if((socket
Solution 1:
I don't see output format setup, so try adding to recorder set up:
recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
Solution 2:
Have a look
And though it is streaming video, so that set -
recorder.setOutputFormat(8);
recorder.setOutputFile(socketFd);
Have fun.
Solution 3:
I've a hack here, extending media recorder class and removing super.setVideoFrameRate(rate) solves the problem for me.
Solution 4:
If you still want to use CamcorderProfile.QUALITY_HIGH
with the front camera, you can use the following:
CamcorderProfile camcorderProfile = CamcorderProfile.get(currentCameraId, CamcorderProfile.QUALITY_HIGH);
recorder.setProfile(camcorderProfile);
where int currentCameraId
is Camera.CameraInfo.CAMERA_FACING_BACK
or ...FRONT
So the profile is indeed dependent on the camera (for high-end phones it appears to work fine without the distinction, since they all support 1080p by now, but low-end phones may crash otherwise)
Post a Comment for "Error Opening Android Camera For Streaming Video"