I want to record raw h.264 video without sound and possibly HW accelerated (and stream it later). So I decided to use MediaRecorder
(and the socket hack for streaming).
I have the following code:
final MediaRecorder recorder = new MediaRecorder();
final Camera camera = Camera.open();
camera.unlock();
recorder.setCamera(camera);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
final CamcorderProfile profile = CamcorderProfile.get(CamcorderProfile.QUALITY_LOW);
recorder.setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight);
recorder.setVideoFrameRate(profile.videoFrameRate);
recorder.setVideoEncodingBitRate(profile.videoBitRate);
recorder.prepare();
recorder.start();
And bam! This in logcat:
E/MediaRecorder﹕ start failed: -38
I started googling, and found plenty of questions and answers, but none about my error code -38
.
So I tried to look at Android source code, and noticed it's native
method, and I don't know where to look for that.
So my big question is: Is there some list of those error codes, so I could find what error -38
means?`
Also know tjat I'm targeting API 10 (Gingerbread) and building with latest SDK 21.